elein <elein@nextbus.com> writes:
> Explain and explain analyze do not seem to count any
> subqueries in functions called.
Functions are considered black boxes. Unless you have an unpublished
solution to the halting problem, I doubt we can do much better than that
for PL-language functions.
I believe there was once code in Postgres (Berkeley era) to try to be
intelligent about the costs of SQL-language functions. It's been dead
code for a long time though, and I'm not currently seeing a good
argument for reviving it. People don't seem to use SQL-language
functions all that much.
regards, tom lane