Обсуждение: cost variable into function
Hi,
i created a stored procedure (function) under postgreSQL and when i checked deeper into my DB, this is what i get:
....
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;
ALTER FUNCTION myschema.get_count_languages(character varying) OWNER TO myuser;
to what corresponds the parameter COST 100 ?
it is the first time i see that :-(
thx.
--
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
i created a stored procedure (function) under postgreSQL and when i checked deeper into my DB, this is what i get:
....
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100;
ALTER FUNCTION myschema.get_count_languages(character varying) OWNER TO myuser;
to what corresponds the parameter COST 100 ?
it is the first time i see that :-(
thx.
--
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008
that's for planner to know. You can estimate cost in there, of that procedure. I usually use select * from something limit 1 times number of rows that procedure returns on average. But I am sure, some more smart people here would have different ways to set it.
On Sun, Oct 19, 2008 at 04:03:47PM +0200, Alain Roger wrote: > i created a stored procedure (function) under postgreSQL and when i checked > deeper into my DB, this is what i get: > .... > END; > $BODY$ > LANGUAGE 'plpgsql' VOLATILE > COST 100; > ALTER FUNCTION myschema.get_count_languages(character varying) OWNER TO > myuser; > to what corresponds the parameter COST 100 ? check the explanation here: http://www.postgresql.org/docs/current/interactive/sql-createfunction.html Best regards, depesz -- Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/ jid/gtalk: depesz@depesz.com / aim:depeszhdl / skype:depesz_hdl / gg:6749007