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

Поиск
Список
Период
Сортировка
От Raymond O'Donnell
Тема Re: Function Question - Inserting into a table with foreign constraints
Дата
Msg-id 4EB55534.9000005@iol.ie
обсуждение исходный текст
Ответ на Re: Function Question - Inserting into a table with foreign constraints  (Brandon Phelps <bphelps@gls.com>)
Список pgsql-general
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@iol.ie

В списке pgsql-general по дате отправления:

Предыдущее
От: Stuart Bishop
Дата:
Сообщение: Re: Excessive planner time for some queries with high statistics
Следующее
От: "Andrus"
Дата:
Сообщение: How to find owning schema in function