Optimizer and function returning setof int4

Started by Teodor Sigaevover 21 years ago1 messages
#1Teodor Sigaev
teodor@sigaev.ru

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@sigaev.ru