Re: Batch API for After Triggers

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Batch API for After Triggers
Date: 2013-06-10 21:50:34
Message-ID: CA+Tgmob9xbiyCpNTZ3qTQWv4bzou1qjCbHiVCDxQ2CB5dd0UEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jun 8, 2013 at 5:00 PM, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> While fiddling with FK tuning, Noah suggested batching trigger
> executions together to avoid execution overhead.
>
> It turns out there is no easy way to write triggers that can take
> advantage of the knowledge that they are being executed as a set of
> trigger executions. Some API is required to allow a trigger to
> understand that there may be other related trigger executions in the
> very near future, so it can attempt to amortise call overhead across
> many invocations ("batching").
>
> The attached patch adds two fields to the TriggerDesc trigger
> functions are handed, allowing them to inspect (if they choose) the
> additional fields and thus potentially use some form of batching.

I'm unclear how this could be used in practice. Are the events in a
"batch" guaranteed to, say, all be related to the same relation?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-06-10 21:58:50 Re: Server side lo-funcs name
Previous Message Robert Haas 2013-06-10 21:43:17 Re: Cost limited statements RFC