Re: can a function return a virtual table?

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: KÖPFERL Robert <robert(dot)koepferl(at)sonorys(dot)at>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: can a function return a virtual table?
Date: 2005-04-19 11:11:53
Message-ID: 20050419111153.GA10314@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Tue, Apr 19, 2005 at 09:34:43 +0200,
KÖPFERL Robert <robert(dot)koepferl(at)sonorys(dot)at> wrote:
> That was a nice answer - rather compleete.
>
> However at least I am questioning myself for a long time about what happens
> if one does a select from a SRF. The function may return millions of records
> (i.e. select * from x where a>1). Is this data streamed through the query
> process or does postgres create a temporary table.
>
> An "explain select * from srf()" just returns a function invocation. :-/
> How does this work?

If the function isn't written using a language of SQL, it isn't going to
optimize well when you only want to see part of the table.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew Sullivan 2005-04-19 13:25:47 Re: Query about SQL in PostgreSQL
Previous Message Richard Huxton 2005-04-19 10:58:29 Re: Query about SQL in PostgreSQL