Re: Returning Composite Types from C functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Returning Composite Types from C functions
Date
Msg-id 12670.1119104089@sss.pgh.pa.us
Whole thread Raw
In response to Re: Returning Composite Types from C functions  (Michael Fuhr <mike@fuhr.org>)
List pgsql-hackers
Michael Fuhr <mike@fuhr.org> writes:
> Maybe one of the developers can comment on why your example calls
> the function only once and mine calls it multiple times per row,
> even though they look similar.

Look at the EXPLAIN results --- one case gets flattened into a single
plan node and the other doesn't.  I know exactly where that particular
skeleton is buried, too:
/* * Hack: don't try to pull up a subquery with an empty jointree. * query_planner() will correctly generate a Result
planfor a * jointree that's totally empty, but I don't think the right things * happen if an empty FromExpr appears
lowerdown in a jointree. Not * worth working hard on this, just to collapse SubqueryScan/Result * into Result... */if
(subquery->jointree->fromlist== NIL)    return false;
 

        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCHES] default database creation with initdb
Next
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] Escape handling in strings