Joel Burton <jburton@scw.org> writes:
> Last night, I was doing some amateurish benchmarking and found that,
> contrary to my (admittedly uninformed) expectation, sql functions seem
> *slower* than plsql functions.
IIRC, sql functions are re-parsed/planned on each execution, whereas
plpgsql functions cache their parse trees and execution plans.
Depending on exactly what you were doing, that might explain the
difference.
regards, tom lane