Re: [HACKERS] Another reason to redesign querytree representation - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Another reason to redesign querytree representation
Date
Msg-id 199907200451.AAA10828@candle.pha.pa.us
Whole thread Raw
In response to Another reason to redesign querytree representation  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> As far as I can see, there is no way to represent doing the Right
> Thing with the current querytree representation.  Either the
> targetlist expression includes a coercion to int4 or it doesn't;
> we can't represent "do the DISTINCT sort and filter on float8,
> *then* coerce to int4" in a single-level targetlist.
> 
> Meanwhile, Jan has been muttering that he can't really do rules
> right without an RTE entry for the result of a sub-select.  And
> the more I look at the UNION/EXCEPT/INTERSECT code, the less I
> like it.
> 
> Maybe it is time to swallow hard and redesign the querytree
> representation?  I think we really need a multi-level-plan
> data structure right out of the starting gate... a format
> closer to the plantree structure that the executor uses would
> probably be less trouble all around.

The current system was designed by me.  It was very little code, and I
was quite suprised it worked as well as it does.  Feel free to redesign
it.  I did it to be small and nimble.  Seems it is not flexible enough.

Got to admit, it is a nice trick to get UNIONS, which is all it was
really designed to do.  At the time, it was neat to get any feature out
of so little code.  Ah, the buggy pre-6.5 days.

--  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 by date:

Previous
From: Tom Lane
Date:
Subject: Another reason to redesign querytree representation
Next
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] Another reason to redesign querytree representation