Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [NOVICE] Compiling Functions in Postgresql

From: Oliver Elphick <olly(at)lfix.co.uk>
Date: Tue Oct 16 2007 - 13:14:49 EDT


On Tue, 2007-10-16 at 02:17 -0400, Jasbinder Singh Bali wrote:
> Hi,
>
> 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
> in
> 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@lfix.co.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.


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly
Received on Tue Oct 16 13:17:44 2007

This archive was generated by hypermail 2.1.8 : Thu Jun 19 2008 - 00:03:15 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library