Optimizer and function returning setof int4

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Optimizer and function returning setof int4
Date: 2004-09-28 10:59:47
Message-ID: 41594423.7030604@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

create table foo (
id int4 primary key,
....
);

create function bar
returns setof int4
langauge 'C'
as '...'
immutable strict
;

So query:
select foo.* from foo, bar() as b where foo.id=b;

Function foo() always returns ordered values and after first call it knows exact
number of results. It seems to me this information may be helpful for query
optimizer, so, is there way to say it to optimizer?

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru

Browse pgsql-hackers by date

  From Date Subject
Next Message Shachar Shemesh 2004-09-28 18:27:21 type unknown - how important is it?
Previous Message Szima Gábor 2004-09-28 08:22:05 pg_stat_activity EXISTS bug in 8.0.0beta3