Re: [GENERAL] Difference between speed of 2 functions: SQL+STABLE and PLPGSQL+EXECUTE

2012-05-07 Thread Albe Laurenz
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".

Re: [GENERAL] Difference between speed of 2 functions: SQL+STABLE and PLPGSQL+EXECUTE

2012-05-02 Thread Dmitry Koterov
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

Re: [GENERAL] Difference between speed of 2 functions: SQL+STABLE and PLPGSQL+EXECUTE

2012-04-27 Thread Albe Laurenz
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

[GENERAL] Difference between speed of 2 functions: SQL+STABLE and PLPGSQL+EXECUTE

2012-04-26 Thread Dmitry Koterov
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, ...)