Re: Constraint Exclusion and Partition Locking

From: Hannu Krosing <hannu(at)skype(dot)net>
To: Rod Taylor <pg(at)rbt(dot)ca>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Constraint Exclusion and Partition Locking
Date: 2006-03-04 19:29:44
Message-ID: 1141500584.3772.15.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ühel kenal päeval, L, 2006-03-04 kell 13:16, kirjutas Rod Taylor:
> Adding a new partition is fairly simple, particularly if you don't care
> about writing RULEs to direct data into it and can rely on a bulk loader
> to figure that part out.
>
> Removing a partition, on the other hand, is currently impossible to do
> without blocking selects against the table as a whole.
>
> The reason for this is that when planning to see if a partition needs to
> be read an AccessShareLock is taken and held for the entire transaction.
>
> If that lock was not there a partition (inherited table) could be
> dropped without any interruptions to normal query processing.
>
> Is it possible to release the AccessShareLock lock on
> "measurement_yy04mm03" after planning has determined that the structure
> will not be used for this query in a "READ COMMITTED" transaction?
> Serializable obviously would have problems with the partitions
> constraint definition changing.

Ar you sure ? I suspect that the change will not be visible to a
serialisable trx.

-------------
Hannu

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stefan Kaltenbrunner 2006-03-04 19:37:01 EXPLAIN and HashAggregate
Previous Message Michael Paesold 2006-03-04 18:42:29 Re: Not so happy with psql's new multiline behavior