Re: Scaling up deferred unique checks and the after trigger queue - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Scaling up deferred unique checks and the after trigger queue
Date
Msg-id 1256486176.8450.4868.camel@ebony
Whole thread Raw
In response to Re: Scaling up deferred unique checks and the after trigger queue  (Dean Rasheed <dean.a.rasheed@googlemail.com>)
Responses Re: Scaling up deferred unique checks and the after trigger queue
List pgsql-hackers
On Mon, 2009-10-19 at 17:48 +0100, Dean Rasheed wrote:

> This is a WIP patch to replace the after-trigger queues with TID bitmaps
> to prevent them from using excessive amounts of memory. Each round of
> trigger executions is a modified bitmap heap scan.

This is an interesting patch. The justification is fine, the idea is
good, though I'd like to see more analysis of the technique, what other
options exist and some thought about when we should use the technique.

We have a bitmap for each UPDATE statement, I think, but there's no docs
or readme. Why just UPDATE? Is the cost of starting up the bitmap higher
than the existing mechanism? Do we need to look at starting with an
existing mechanism and then switching over to new mechanism? Is the TID
bitmap always a win for large numbers of rows?

The technique relies on these assumptions
* Trigger functions are idempotent
* Trigger execution order is not important (in terms of rows)
* Multiple trigger execution order is not important

All of those seem false in the general case. What will you do?

-- Simon Riggs           www.2ndQuadrant.com



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Parsing config files in a directory
Next
From: Robert Haas
Date:
Subject: per-tablespace random_page_cost/seq_page_cost