Re: [PORTS] Port Bug Report: Wild memory use for badly written SQL

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Urban Widmark <urban(at)svenskatest(dot)se>
Cc: pgsql-ports(at)postgreSQL(dot)org
Subject: Re: [PORTS] Port Bug Report: Wild memory use for badly written SQL
Date: 1999-06-02 20:09:14
Message-ID: 199906022009.QAA09293@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message G. Anthony Reina 1999-06-02 21:58:29 Re: [PORTS] Windows 95 PgAccess Help with PSQL
Previous Message Unprivileged user 1999-06-02 19:23:17 Port Bug Report: Wild memory use for badly written SQL