On Tue, 2007-10-16 at 02:17 -0400, Jasbinder Singh Bali wrote:
> I know that in Sql Server, Stored Procedures are compiled only once
> and then the same execution plan is utilized. This definitely gives a
> tremendous performance boost
> when Stored Procedures are called repeatedly.
> Now, in Postgresql, how are the User Defined Functions compiled. Is it
> just once or every single time a function is called.
> I used Function instead of Stored Procedure while talking about
> Postgresql because Stored Procedures in Postgresql are Wrapped around
> a User Defined Function.
Functions are evaluated the first time that they are called in a
session. At that point the plan for any database operations is done and
it is left available for future executions within the same session.
A session is from user connection to disconnection.
Oliver Elphick olly(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
Do you want to know God? http://www.lfix.co.uk/knowing_god.html
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
In response to
pgsql-novice by date
|Next:||From: Hans-Peter Oeri||Date: 2007-10-16 21:05:12|
|Subject: Implementation of a updateable, "temporal" view on data|
|Previous:||From: Jasbinder Singh Bali||Date: 2007-10-16 06:17:59|
|Subject: Compiling Functions in Postgresql|