Re: Touch row ?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Touch row ?
Дата
Msg-id 3674.1074964733@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Touch row ?  (Eric B.Ridge <ebr@tcdi.com>)
Ответы Re: Touch row ?  (Eric B.Ridge <ebr@tcdi.com>)
Список pgsql-general
"Eric B.Ridge" <ebr@tcdi.com> writes:
> [ update timestamp via a rule ]
> explain analyze update foo_view set id = 1 where id = 1;
> Average runtime for 10 executions:  0.165ms
> [ update timestamp via a trigger ]
> explain analyze update foo2 set id = 1 where id = 1;
> Average runtime for 10 executions: 0.328ms

This surprises me.  There's a moderate amount of overhead involved in
a plpgsql trigger, but I'd not have thought it would swamp the added
inefficiencies involved in a rule.  Notice that you're getting a double
indexscan in the rule case --- that takes more time to plan, and more
time to execute (observe the nearly double actual time for the top level
plan node).

What were you averaging here --- just the "total runtime" reported by
EXPLAIN ANALYZE?  It would be interesting to factor in the planning time
too.  Could you retry this and measure the total elapsed time?  (psql's
\timing command will help.)

            regards, tom lane

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: pl/pgsql docs 37.4.3. Row Types -- how do I use this
Следующее
От: Andreas
Дата:
Сообщение: Is there something like an dynamic view ?