You are here: Re: mysql query optimization « PHP SQL « IT news, forums, messages
Re: mysql query optimization

Posted by Stefan Rybacki on 12/15/05 17:26

Anze wrote:
> Hi all!
>
> I stumbled across this query that I just can't optimize - even if I create
> all possible indexes it doesn't use them. Could someone please clue me in?
> I have no idea why MySQL doesn't use the indexes. :(
>
> The query in question is:
>
> mysql> explain select count(a0.count) from srchIds ids, srchWords a0 where
> a0.word LIKE '%abc%' and a0.id=ids.id group by ids.category;

The problem is your like clause, because you use leading % mysql isn't able to
use an index for it. To speed this up you could try to use the fulltext
functions and the fulltext index of mysql but that isn't sure to help you.

>
> Thank you!

Regards
Stefan

>
> Anze

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация