> select * from ts_syllabus where
> (ts_key like '1%' and ts_lang='swe') or
> (ts_key like '2%' and ts_lang='swe') or
> (ts_key like '3%' and ts_lang='swe') or
> (ts_key like '4%' and ts_lang='swe') or
> (ts_key like '5%' and ts_lang='swe') or
> (ts_key like '6%' and ts_lang='swe') or
> (ts_key like '7%' and ts_lang='swe') or
> (ts_key like '8%' and ts_lang='swe') or
> (ts_key like '9%' and ts_lang='swe')
This is a mix of two issues, the indexing of LIKE converts the above to
a more complex case that can use indexes, and OR's explode the query
optimizer's conversion of the where clause to CNF format. Not much we
can do in the short term to fix this.
--
Bruce Momjian | http://www.op.net/~candle
maillist@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026