On 22-Aug-2001 Osus wrote:
> Hi,
> 
> The slow queries are those like...
> 
> SELECT id FROM table WHERE field like '%text%' AND ok=1 AND type=1
> 
> where table have about 20.000 records and field is a text field.
> I need to find ALL the records  that have "text", even if text is "a" i have
> to find all the records that have one "a".
> 
> Many of that querys take 16 or 20 seconds.
> 
> what do you think?
> 

Try index(es) on 'ok' and 'type' (isn't 'type' was a reserved word ?).
Depending on the range -- it might narrow the scope.

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
                            (53kr33t w0rdz: sql table query)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to