MySQL Forums
Forum List  »  Newbie

Optimizing LIKE '%..%' performance
Posted by: bfoster
Date: May 06, 2005 04:00PM


Can anyone help me with this one, because I have reached the end of my 'limited' SQL knowledge? I am currently searching a table (170,000 rows) of film and TV data.
I need to search on the title, although as the titles have no standard as to their naming I am having to do the following to pick out rows with similar titles, eg for all the 'red dwarf series 4' I'm using :

select name, actors, director, link from table where like '%red%' AND like '%dwarf%' AND like '%series%' AND like '%4%'

Which picks out all the differently named but similar entries for this show, ie if they are named 'Series 4, Red Dwarf' or 'Red Dwarf - Series 4' for example. But - it is very slow. I've tried indexing, but have heard that this makes no difference when using like '%...%'. Can any cluded up SQL guru prehaps suggest an alternative or some kind of fix to help speed things up?

Many thanks.


Options: ReplyQuote

Written By
Optimizing LIKE '%..%' performance
May 06, 2005 04:00PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.