Tom Lane wrote:
>Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net> writes:
>
>
>>given the power of SETOF/ROWTYPE functions etc are select-only
>>views becoming obsolete/redundant ?
>>
>>
>
>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. For example, in
> SELECT * FROM my_srf() WHERE foo
>there's no way to push the "foo" condition down inside my_srf().
>
>
>
Does that include SQL functions ? i.e.
CREATE FUNCTION ParameterizedQuery(integer) RETURNS setof c AS '
select $1 as a, b from c where $1 = c.z + c.x;
' LANGUAGE SQL;