Re: stored procedures for complex SELECTs

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: alex-lists-pgsql(at)yuriev(dot)com
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: stored procedures for complex SELECTs
Date: 2006-01-18 23:39:16
Message-ID: F4383AC1-E004-4883-8883-F5B5AF449658@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


On Jan 19, 2006, at 8:17 , alex-lists-pgsql(at)yuriev(dot)com wrote:

> Are there performance advantages that can be achieved by wrapping a
> complex SELECT into a stored procedure?

I believe it depends on the procedural language. If it's SQL, I think
it may be inlined, so you'd have overhead due to the stored procedure
rather than the select itself would probably be minimal. In any other
language, there would be additional parsing overhead, I believe, so I
don't think it would be faster than the select itself.

However, why don't you test it? Test each case in an EXPLAIN ANALYZE
or run some other benchmark to see if there's a performance
difference. Then you'll know for sure—and have numbers to back it up.

Michael Glaesemann
grzm myrealbox com

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Juris 2006-01-19 12:39:47 Error calling self-made plpgsql function "function XYZ(bigint) does not exist"
Previous Message alex-lists-pgsql 2006-01-18 23:17:14 stored procedures for complex SELECTs