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

Re: [HACKERS] 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: jwieck(at)debis(dot)com, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)
Date: 1998-10-02 21:39:05
Message-ID: 199810022139.RAA21082@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> > Another idea is that we rewrite queries such as:
> >
> > 	SELECT *
> > 	FROM tab
> > 	WHERE (a=1 AND b=2 AND c=3) OR
> > 	      (a=1 AND b=2 AND c=4) OR
> > 	      (a=1 AND b=2 AND c=5) OR
> > 	      (a=1 AND b=2 AND c=6)
> >
> > into:
> >
> > 	SELECT *
> > 	FROM tab
> > 	WHERE (a=1 AND b=2) AND (c=3 OR c=4 OR c=5 OR c=6)
> 
> Very nice, but that's like trying to code factorization of numbers... not
> pretty, and very CPU intensive on complex queries...

Yes, but how large are the WHERE clauses going to be?  Considering the
cost of cnfify() and UNION, it seems like a clear win.  Is it general
enough to solve our problems?

-- 
  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: TaralDate: 1998-10-02 21:49:26
Subject: RE: [HACKERS] RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)
Previous:From: Bruce MomjianDate: 1998-10-02 21:34:05
Subject: Re: [HACKERS] Open 6.4 items

pgsql-general by date

Next:From: TaralDate: 1998-10-02 21:49:26
Subject: RE: [HACKERS] RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)
Previous:From: TaralDate: 1998-10-02 21:12:19
Subject: RE: [HACKERS] RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)

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