On Wed, 25 Apr 2001, Tom Lane wrote: > Joel Burton <[EMAIL PROTECTED]> 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. Why is this? I'm just delving into the source code in earnest for the first time, so, forgive any awful errors, but it seems like we have the plumbing for this in views/rules... couldn't the parse tree be cached from this for each backend? Or are SQL functions mildly deprecated since they could always be replaced by the plpgsql function begin return ... end; ? -- Joel Burton <[EMAIL PROTECTED]> Director of Information Systems, Support Center of Washington ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl