Why don't use FULLTEXT index ? This select doesn't use normal index so 
you have a sort of linear search

Chai-Hup Chen wrote:

> Hi,
>   I find in our database, select "% string %" is very slow (>1
> minute).  The database size have only 2M rows,  any idea how could I get
> faster response?  Thanks a lot.
> 
> CREATE TABLE Books (
>   isbn char(10) NOT NULL default '',
>   Title char(255) NOT NULL default '',
>   KEY isbn (isbn),
>   KEY Title (Title)
> }
> 
> select count(*) from Books  -> 2028971
> 
> select count(*) from Books where Title like "% cisco %";
> +----------+
> | count(*) |
> +----------+
> |       86 |
> +----------+
> 1 row in set (1 min 25.09 sec)
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 

-- 
--
Antonio Gulli'        Ideare S.p.a          tel: (+39) 050  575300
[EMAIL PROTECTED]      Lungarno Mediceo 56   fax: (+39) 050  575583
whois:   AG2-ORG      I-56126 Pisa, Italy   http://www.ideare.com net: 

print pack"C*",split/\D+/,`echo "16iII*o\U@{$/=$z;[(pop,pop,unpack"H*",<>
)]}\EsMsKsN0[lN*1lK[d2%Sa2/d0<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<J]dsJxp"|dc`
 




---------------------------------------------------------------------
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