Skip site navigation (1) Skip section navigation (2)

Re: Compiling Functions in Postgresql

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Jasbinder Singh Bali <jsbali(at)gmail(dot)com>
Cc: Novice Postgresql-list <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Compiling Functions in Postgresql
Date: 2007-10-16 17:14:49
Message-ID: 1192554889.10677.176.camel@linda.lfix.co.uk (view raw or flat)
Thread:
Lists: pgsql-novice
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(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 OeriDate: 2007-10-16 21:05:12
Subject: Implementation of a updateable, "temporal" view on data
Previous:From: Jasbinder Singh BaliDate: 2007-10-16 06:17:59
Subject: Compiling Functions in Postgresql

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group