Re: [PERFORM] SQL functions vs. PL/PgSQL functions

2010-10-14 Thread Tom Lane
Merlin Moncure writes: > On Wed, Oct 13, 2010 at 10:14 AM, Tom Lane wrote: >> It's possible that at some point we'll try to introduce plan caching >> for non-inlined SQL functions. > hm, I think the search_path/function plan issue would have to be dealt > with before doing this -- Yeah, perhaps

Re: [PERFORM] SQL functions vs. PL/PgSQL functions

2010-10-14 Thread Merlin Moncure
On Wed, Oct 13, 2010 at 10:14 AM, Tom Lane wrote: > It's possible that at some point we'll try to introduce plan caching > for non-inlined SQL functions. hm, I think the search_path/function plan issue would have to be dealt with before doing this -- a while back IIRC you suggested function plans

Re: [PERFORM] SQL functions vs. PL/PgSQL functions

2010-10-13 Thread Reuven M. Lerner
Wow. Thanks so much to all of you for the thoughtful and helpful responses! Reuven -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance

Re: [PERFORM] SQL functions vs. PL/PgSQL functions

2010-10-13 Thread Tom Lane
"Reuven M. Lerner" writes: > All of the database-related logic for this application is in server-side > functions, written in PL/PgSQL. That is, the application never issues a > SELECT or INSERT; rather, it invokes a function with parameters, and the > function handles the query. It's not unusu

Re: [PERFORM] SQL functions vs. PL/PgSQL functions

2010-10-13 Thread Merlin Moncure
On Wed, Oct 13, 2010 at 3:30 AM, Reuven M. Lerner wrote: > Hi, everyone.  I'm working with a client to try to optimize their use of > PostgreSQL.  They're running 8.3 on a Windows platform, packaged as part > of a physical product that is delivered to customers. > > We're planning to upgrade to 9.

Re: [PERFORM] SQL functions vs. PL/PgSQL functions

2010-10-13 Thread Craig Ringer
On 13/10/2010 3:30 PM, Reuven M. Lerner wrote: My question is whether this is somehow to be expected. Under what conditions will SQL functions be slower than PL/PgSQL functions? The main cases I can think of: - Where the SQL function is inlined (PL/PgSQL functions can't be inlined, some SQL

[PERFORM] SQL functions vs. PL/PgSQL functions

2010-10-13 Thread Reuven M. Lerner
Hi, everyone. I'm working with a client to try to optimize their use of PostgreSQL. They're running 8.3 on a Windows platform, packaged as part of a physical product that is delivered to customers. We're planning to upgrade to 9.0 at some point in the coming months, but this question is relevant