Rob Sargent wrote:
Richard Huxton wrote:
Rob Sargent wrote:
pg-admin is showing 'COST 100' and 'ROWS 1000' for my explicitly VOLATILE functions.

Thanks for the pointer back to CREATE FUNCTION docs. That would have told me that those value are indeed the defaults. I guess I'm somewhat surprised that they are in fact defautled. "COST" is too arbitrary for me to comment on, but my functions' results sets fall on both sides of 1000 rows, so I'm not sure giving this value to the planner does a lot of good. Luckily, my functions are typically pretty much stand-alone calls, and not part of some larger query.

If your functions are all called at the top-level then indeed it doesn't matter. At a low level though, telling the planner function F1 costs 1000 times more than F2 is useful.

--
  Richard Huxton
  Archonet Ltd

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to