Re: Batch API for After Triggers - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Batch API for After Triggers
Date
Msg-id CA+Tgmob9xbiyCpNTZ3qTQWv4bzou1qjCbHiVCDxQ2CB5dd0UEQ@mail.gmail.com
Whole thread Raw
In response to Batch API for After Triggers  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Batch API for After Triggers
List pgsql-hackers
On Sat, Jun 8, 2013 at 5:00 PM, Simon Riggs <simon@2ndquadrant.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



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Cost limited statements RFC
Next
From: Robert Haas
Date:
Subject: Re: Server side lo-funcs name