Re: [SQL] problem with OR'ed AND queriess

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [SQL] problem with OR'ed AND queriess
Дата
Msg-id 13399.945820920@sss.pgh.pa.us
обсуждение исходный текст
Ответ на problem with OR'ed AND queriess  (Michael McCarthy <michael@tcsi.com>)
Список pgsql-sql
Michael McCarthy <michael@tcsi.com> writes:
> I have traced the backend server in a debugger; a stack trace is attached
> below. What I see in examining the code is a recursive normalization of
> the query; postgres is running out of memory trying to convert the OR'ed
> ANDs query to conjunctive normal form (CNF).

Yes, the CNF-conversion code is pretty awful.  I have reduced its
badness somewhat in current sources, but really we need to rethink the
whole problem --- for queries that are naturally expressed as
OR-of-ANDs, forcing the condition into AND-of-ORs is a loser.

You could try folding prepqual.c from current sources (get the nightly
snapshot or use CVS) into 6.5.  I'm not sure it would merge cleanly,
but it'd beat reinventing the fixes I made.
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: Michael McCarthy
Дата:
Сообщение: Re: [SQL] problem with OR'ed AND queriess
Следующее
От: "Stuart Gopen"
Дата:
Сообщение: query result formatting