Why does this:
create or replace function dummy() returns double precision as $$ SELECT random() $$ LANGUAGE SQL COST 777; explain select dummy();
Result (cost=0.00..0.01 rows=1 width=0)
and not a cost of 777?
I believe the costs refer to different units of measurement. The
For function cost details, see http://www.postgresql.org/docs/current/static/sql-createfunction.html