On Wed, Aug 13, 2003 at 02:22:32PM +0200, Harald Fuchs wrote: > In article <[EMAIL PROTECTED]>, > Jeremy Zawodny <[EMAIL PROTECTED]> writes: > > >> Query is: > >> > >> Select * from table where keywords like '%blah%' or caption like '%blah%' or > >> headline like '%blah%' or cat like '%blah%' limit 20,10 > >> > >> > >> Note: I can not use keywords like 'blah%' it has to be '%blah%' only... (i.e balh > >> can be even middle part of the words) > >> > >> Table contains 50,000 records and queries taking 7 sec which is unbelievable. > >> > >> Mysql version: 3.23.52 > >> > >> Please suggest me some solution for this. > > > It's not the OR that's doing it. IT's the %blah% queries. Look at > > MySQL's FULLTEXT indexes. I suspect they'll help A LOT. > > Nope. Binay said that 'blah' can be the middle part of a word. > FULLTEXT IN BOOLEAN MODE will help only if it's the beginning of a > word.
Well, I interpreted "can be" to mean that it happens once in a while. But, yeah, that makes it a lot less efficient. MySQL's not a search engine. Perhaps he needs some other technology here. Jeremy -- Jeremy D. Zawodny | Perl, Web, MySQL, Linux Magazine, Yahoo! <[EMAIL PROTECTED]> | http://jeremy.zawodny.com/ MySQL 4.0.13: up 11 days, processed 431,057,439 queries (420/sec. avg) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]