Re: time penalties on triggers?

Поиск
Список
Период
Сортировка
От Kenneth Downs
Тема Re: time penalties on triggers?
Дата
Msg-id 470637BF.6070801@secdat.com
обсуждение исходный текст
Ответ на time penalties on triggers?  ("Jan Theodore Galkowski" <bayesianlogic@acm.org>)
Ответы Re: time penalties on triggers?  (Vivek Khera <vivek@khera.org>)
Список pgsql-general
Jan Theodore Galkowski wrote:
> Does anyone know, or can anyone point to information about how much
> triggers penalize inserts in PG tables?  I'm getting a report that it is
> substantial, and before I investigate more.  The triggers in question
> look like:
>

I use triggers everywhere.  About a year ago I did some very simple
tests, 1000's of inserts to tables, then 1000s of inserts to the same
tables with all triggers disabled.

What I found was that the largest factor in performance was the size of
the row being inserted.  This makes sense since Postgres uses MVCC.

I also found it very hard to pin down the penalty of the trigger, but
came up with rough figures of 30-50% overhead.  The complexity of the
trigger did not matter.

This all made sense based on the fact that writing to disk takes
infinitely more time than processing trigger code, so the penalty seems
to come into play as overhead in firing the trigger.





--
Kenneth Downs
Secure Data Software, Inc.
www.secdat.com    www.andromeda-project.org
631-689-7200   Fax: 631-689-0527
cell: 631-379-0010


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

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: Find min year and min value
Следующее
От: "Josh Tolley"
Дата:
Сообщение: Re: Design Question (Time Series Data)