Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: taral(at)mail(dot)utexas(dot)edu (Taral)
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)
Date: 1998-10-02 02:18:29
Message-ID: 199810020218.WAA23299@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> > > Wouldn't disjunctive normal form be better, since it can be
> > implemented as
> > > the simple union of a set of small queries?
> >
> > Please tell us more.
> 
> Well, I don't know how the backend processes queries, but one can imagine
> this scenario (for DNF):
> 
> 1) Analyze query and set up columns in result table
> 2) Rewrite query into DNF
> 3) Split query into subqueries
> 4) For each subquery:
>   a) Process query
>   b) Append matching tuples to result table
> 5) Do any post-processing (ORDER BY, etc.)
> 6) Return result
> 
> How is the processing currently done (with CNF)?

It currently convert to CNF so it can select the most restrictive
restriction and join, and use those first.  However, the CNF conversion
is a memory exploder for some queries, and we certainly need to have
another method to split up those queries into UNIONS.  I think we need
to code to identify those queries capable of being converted to UNIONS,
and do that before the query gets to the CNF section.  That would be
great, and David Hartwig has implemented a limited capability of doing
this, but we really need a general routine to do this with 100%
reliability.


-- 
  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

pgsql-hackers by date

Next:From: Bruce MomjianDate: 1998-10-02 02:24:20
Subject: Re: [HACKERS] It sorta works, but I'm confused about locking
Previous:From: Bruce MomjianDate: 1998-10-02 02:01:41
Subject: Re: [HACKERS] initdb question

pgsql-general by date

Next:From: TaralDate: 1998-10-02 05:35:12
Subject: RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)
Previous:From: Bruce MomjianDate: 1998-10-02 01:56:06
Subject: Re: [GENERAL] IN/NOT IN operators

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group