Re: [HACKERS] don't know whether nodes of type 719 are equal

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] don't know whether nodes of type 719 are equal
Date: 1999-10-18 00:49:53
Message-ID: 199910180049.UAA19914@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> (consults include/nodes/nodes.h ... hmm, "SortClause" ...)
>
> This is probably happening because UNION/INTERSECT processing tries
> to simplify the node tree using cnfify(), which is really designed
> to work on expressions not whole queries. Ordinarily you can't get a
> sort clause into a subclause of a UNION ... but I guess with DISTINCT
> you can. (I bet UNIONing things containing GROUP BY fails too,
> since equal() doesn't know about GroupClause nodes either.)
>
> A quick-fix answer is to extend equal(), of course, but I've been
> wondering for a while why we are cnfify'ing UNION/INTERSECT trees
> at all. The odds of being able to simplify the tree that way seem
> small, and what's worse is that UNION does *not* have the same
> semantics as OR (eg, foo UNION foo should *not* be simplified to foo)
> but cnfify doesn't know that.

My recollection is that cnfify is not called to simplify, but was
required at one point so you got the right output. That may no longer
be the case, but I know it was at some point. Before installed kqso,
the author tried to just skip cnfify, and the query with OR's didn't
work. Of course, none of us understood cnfify(), so just scratched our
heads.

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

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-10-18 00:50:32 Re: [HACKERS] Re: ORACLE COMMENT statement
Previous Message Hiroshi Inoue 1999-10-17 23:59:12 RE: [HACKERS] vacuum of permanently updating database