Re: Patch: clean up addRangeTableEntryForFunction - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Patch: clean up addRangeTableEntryForFunction
Date
Msg-id 4902.1358913738@sss.pgh.pa.us
Whole thread Raw
In response to Patch: clean up addRangeTableEntryForFunction  (David Fetter <david@fetter.org>)
Responses Re: Patch: clean up addRangeTableEntryForFunction
List pgsql-hackers
David Fetter <david@fetter.org> writes:
> I've been working with Andrew Gierth (well, mostly he's been doing the
> work, as usual) to add WITH ORDINALITY as an option for set-returning
> functions.  In the process, he found a minor opportunity to clean up
> the interface for $SUBJECT, reducing the call to a Single Point of
> Truth for lateral-ness, very likely improving the efficiency of calls
> to that function.

As I mentioned in our off-list discussion, I think this is going in the
wrong direction.  It'd make more sense to me to get rid of the
RangeFunction parameter, instead passing the two fields that
addRangeTableEntryForFunction actually uses out of that.  If we do what
you have here, we'll be welding together the alias and lateral settings
for the new RTE; which conceivably some other caller would want to
specify in a different way.  As a comparison point, you might want to
look at the various calls to addRangeTableEntryForSubquery: some of
those pass multiple fields out of the same RangeSubselect, and some
do not.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Xi Wang
Date:
Subject: [RFC] overflow checks optimized away
Next
From: Robert Haas
Date:
Subject: Re: Event Triggers: adding information