RE: [PHP-DB] %Like%
| From: | Craig Vincent | Date: | Wed, 12 Jul 2000 12:26:42 +0000 |
| Subject: | RE: [PHP-DB] %Like% | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1072@lists.php.net to get a copy of this message | ||
<snip>
Don't know about the O(n). In Paul Dubois' book,
he recommends not using the double %what% unless that's
actually what you need. It's got something to do with
better optimization if you can use the what% form.
</snip>
Hey Mike,
You're absolutely right. When you do a query using LIKE , if you use the
'%foo%' format, MySQL will NOT use any indexes on that column and hence
there probably be a slowdown if the server needs to do a full table scan and
there's a lot of records to sift through. I actually believe '%foo' also
will not use an Indexes.
Sincerely,
Craig Vincent