Re: [PORTS] Port Bug Report: Wild memory use for badly written SQL
От | Bruce Momjian |
---|---|
Тема | Re: [PORTS] Port Bug Report: Wild memory use for badly written SQL |
Дата | |
Msg-id | 199906022009.QAA09293@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Port Bug Report: Wild memory use for badly written SQL (Unprivileged user <nobody>) |
Ответы |
Re: [PORTS] Port Bug Report: Wild memory use for badly written SQL
|
Список | pgsql-ports |
> 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
В списке pgsql-ports по дате отправления: