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

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] don't know whether nodes of type 719 are equal
Дата
Msg-id 199910180049.UAA19914@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] don't know whether nodes of type 719 are equal  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [HACKERS] don't know whether nodes of type 719 are equal
Список 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@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: "Hiroshi Inoue"
Дата:
Сообщение: RE: [HACKERS] vacuum of permanently updating database
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] Re: ORACLE COMMENT statement