Обсуждение: Compiling Functions in Postgresql
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.
Please let me know.
Thanks,
Jas
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.
Please let me know.
Thanks,
Jas
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.