Re: Performance: sql functions v. plpgsql v. plperl - Mailing list pgsql-general

From Tom Lane
Subject Re: Performance: sql functions v. plpgsql v. plperl
Date
Msg-id 29144.988215099@sss.pgh.pa.us
Whole thread Raw
In response to Performance: sql functions v. plpgsql v. plperl  (Joel Burton <jburton@scw.org>)
Responses Re: Performance: sql functions v. plpgsql v. plperl
List pgsql-general
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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Converting queries to upper case
Next
From: Tom Lane
Date:
Subject: Re: indices are crashed after installation of rpm