Search Postgresql Archives

Re: Function Question - Inserting into a table with foreign constraints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/11/2011 14:46, Brandon Phelps wrote:
> 
> With the method you outlined will I notice any huge performance
> impacts?  The application would be parsing incoming data from another
> 3rd party application and could, at times, be executing the function in
> very fast succession, although never twice at the exact same moment
> (single threaded application, pending events will just block until
> they're up).

I honestly don't know... your best bet would be to benchmark and see.
I'd guess that any changes to the code within the function would have
less effect than local conditions - disk I/O, processor speed, etc.

AIUI, putting your code into a function has the advantage that the
Potgres only has to load pl/pgsql and parse the function once for any
given connection, and then the plan is reused for all subsequent
invocations coming from that connection.

If the function is only going to be called once per connection, then you
have the overhead of loading pl/pgsql each time it is called, on top of
parsing the function; so you might be better off trying to do this
outside of a function altogether.

Ray.

-- 
Raymond O'Donnell :: Galway :: Ireland
rod@xxxxxx

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux