Re: WIP patch: convert SQL-language functions to return tuplestores - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WIP patch: convert SQL-language functions to return tuplestores
Date
Msg-id 13894.1225108943@sss.pgh.pa.us
Whole thread Raw
In response to Re: WIP patch: convert SQL-language functions to return tuplestores  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: WIP patch: convert SQL-language functions to return tuplestores
List pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:
> On Sun, Oct 26, 2008 at 09:49:49PM -0400, Tom Lane wrote:
>> So I'm concluding that we can easily afford to switch to tuplestore-always
>> operation, especially if we are willing to put any effort into tuplestore
>> optimization.

> I thought that the bad case for a tuplestore was if the set returning
> function was expensive and the user used it with a LIMIT clause. In the
> tuplestore case you evaluate everything then throw it away.

I'm not terribly excited by that example --- but in any case, the real
solution to any problem that involves communication between function and
calling query is to make sure that the function can get inlined into the
query.  That was an option we didn't have back in 8.2; but it's there
now.  My test case deliberately disables that optimization ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Parsing errors in pg_hba.conf
Next
From: Heikki Linnakangas
Date:
Subject: Visibility map, partial vacuums