Optimizer and function returning setof int4 - Mailing list pgsql-hackers

From Teodor Sigaev
Subject Optimizer and function returning setof int4
Date
Msg-id 41594423.7030604@sigaev.ru
Whole thread Raw
List 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
thisinformation may be helpful for query 
 
optimizer, so, is there way to say it to optimizer?


-- 
Teodor Sigaev                                  E-mail: teodor@sigaev.ru


pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: Reviving Time Travel (was Re: 'TID index')
Next
From: Shachar Shemesh
Date:
Subject: type unknown - how important is it?