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.