Dmitry Koterov wrote:
> But it's quite strange that SQL+STABLE function does not recalculate
the plan each time it is called.
> Because when I use a bunch of SQL+STABLE functions in e.g. a
sub-select of a complex query, I see in
> the plan of this complex queries that function calls are "expanded".
Albe, thanks for detailed explaination.
But it's quite strange that SQL+STABLE function does not recalculate the
plan each time it is called. Because when I use a bunch of SQL+STABLE
functions in e.g. a sub-select of a complex query, I see in the plan of
this complex queries that function calls ar
Dmitry Koterov wrote:
> For example, I have 2 functions like these:
>
> CREATE OR REPLACE FUNCTION first(a INTEGER, b INTEGER, ...) RETURNS
... AS
> $body$
> ...any SQL which uses $1, $2 etc. arguments, plus LIMIT $3...
> $body$
> LANGUAGE 'sql'
> STABLE
>
>
> and
>
>
> CREATE OR REPLACE F
Hello.
For example, I have 2 functions like these:
CREATE OR REPLACE FUNCTION first(a INTEGER, b INTEGER, ...) RETURNS ... AS
$body$
...any SQL which uses $1, $2 etc. arguments, plus LIMIT $3...
$body$
LANGUAGE 'sql'
*STABLE*
and
CREATE OR REPLACE FUNCTION second(a INTEGER, b INTEGER, ...)