Re: Most Efficient Query
| From: | David Robley | Date: | Thu, 22 Jul 2004 09:09:23 +0000 |
| Subject: | Re: Most Efficient Query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191494@lists.php.net to get a copy of this message | ||
On Thu, 22 Jul 2004 17:44, Monty wrote:
> I'm writing a simple search script in PHP and wasn't sure whether the best
> way to search for the records in MySQL was this way...
>
> SELECT * FROM db WHERE field1 LIKE "var%" OR field2 LIKE "var%" ...
>
> ...or would it be faster and more efficient to use fulltext indexes with
> MATCH() and AGAINST()? I have MySQL 3.23.58 installed on my server.
>
> Thanks!
Depends what you want to do - for instance fulltext search IIRC does not
support substring searches.
--
David Robley
I Have To Stop Now, My Fingers Are Getting Hoarse!