pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael McCarthy <michael@tcsi.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] problem with OR'ed AND queriess
Date: Tue, 21 Dec 1999 19:02:00 -0500
Message-ID: <13399.945820920@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.GSO.3.96.991221112043.9161G-100000@sanmarino.tcsi.com>
References: <Pine.GSO.3.96.991221112043.9161G-100000@sanmarino.tcsi.com>

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



view thread (7+ messages)  latest in thread

Message-ID: <13399.945820920@sss.pgh.pa.us>
Permalink:  ../13399.945820920@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/13399.945820920@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael@tcsi.com
  Subject: Re: [SQL] problem with OR'ed AND queriess
  In-Reply-To: <13399.945820920@sss.pgh.pa.us>
  References: <Pine.GSO.3.96.991221112043.9161G-100000@sanmarino.tcsi.com> <13399.945820920@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox