On Wed, 22 Sep 1999, Brian Moon wrote:
> select general.id, general.thread, author, subject, datestamp, body from
> general left join general_bodies on general.id = general_bodies.id where
> datestamp > '1999-03-26' ) and (body like "%g3%" OR subject like "%g3%" OR
> author like "%g3%") order by id desc
You are losing indexing usage on the like clauses. Check for the "g3"
string in the relevant fields at the INSERT time and add a column to this
table that is a lag indicating when "g3" (or whatever) exists. You can
then index on this new flag to avoid all the extra LIKE clauses which is
slowing the query down greatly.
| Greg Patterson | EMAIL: gomer@stripped |
| | gomer@stripped |
| Linux: The choice of a | IRC: xed (Irc.OpenProjects.Net) |
| GNU generation! | WWW: http://www.linuxhelp.org/ |