Re: Batch API for After Triggers

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Batch API for After Triggers
Дата
Msg-id 20130609103323.GB12924@svana.org
обсуждение исходный текст
Ответ на Re: Batch API for After Triggers  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
On Sun, Jun 09, 2013 at 10:15:09AM +0100, Simon Riggs wrote:
> As I mentioned in my post, I did consider that and then chose not to
> do that. However, having a final func is a major modification in the
> way that we specify trigger functions. We'd also need to cope with
> recursive trigger execution, which would mean the final func would get
> called potentially many times, so there's no way of knowing if the
> final func is actually the last call needed. That sounded complex and
> confusing to me.
>
> The proposed API allows you to do exactly that anyway, more easily, by
> just waiting until tg_event_num == tg_tot_num_events.

Can you signal partial completion? For example, if a trigger know that
blocks of 10,000 are optimal and it sees tg_tot_num_events == 1,000,000
that it could do work every 10,000 entries, as in when:

(tg_event_num % 10000) == 0 || tg_event_num == tg_tot_num_events

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> He who writes carelessly confesses thereby at the very outset that he does
> not attach much importance to his own thoughts.  -- Arthur Schopenhauer

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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: Vacuum, Freeze and Analyze: the big picture
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Batch API for After Triggers