List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:June 11 1999 7:06pm
Subject:more efficient queries
View as plain text  
>>>>> "pete" == pete collins <pcollins@stripped> writes:

pete> I wrote a keyword search engine using PHP and mysql that does a bunch of
pete> queries
pete> similar to the one below.

pete> "SELECT fullname, id, city, state, specialty, zip FROM doctors WHERE
pete> fullname LIKE
pete> '$Udoctor%' AND id > $id ORDER BY id";

pete> The table is about 308,428 rows
pete> So it is pretty big.
pete> Speed is acceptable, but I think I can make it even faster.


pete> Is there anything I can do to make it quicker?
pete> I am stuck using LIKE  because it is a keyword search.
pete> My primary key is "id".

pete> Thanks

pete> Pete Collins

Hi!

If you add a LIMIT clause, the above will probably be a lot faster.
I assume you have a key on 'fullname'...

Regards,
Monty
Thread
more efficient queriespete collins11 Jun
  • Re: more efficient queriesSasha Pachev11 Jun
    • Re: more efficient queriesOliver Artelt11 Jun
  • more efficient queriesMichael Widenius11 Jun
  • Re: more efficient queriespete collins11 Jun
  • Re: more efficient queriespete collins11 Jun
    • Re: more efficient queriesBenjamin Pflugmann12 Jun
  • Re: more efficient queriespete collins14 Jun