Gianni Mariani <gianni(at)mariani(dot)ws> writes:
> Tom Lane wrote:
>> Not hardly. The planner can optimize queries involving views, since it
>> can see what's inside the view definition. SRFs are black boxes and
>> thus not optimizable.
> Does that include SQL functions ?
Hm. A SQL function that contains a single SELECT could probably be
inlined, but it's not at the moment. CVS tip does inline SQL functions
that return scalars, but not sets. Good idea ...
regards, tom lane