Strange behavior with pg_locks and partitioning

Поиск
Список
Период
Сортировка
Искать

Strange behavior with pg_locks and partitioning

От:
Josh Berkus <josh@agliodbs.com>
Дата:
All,

In the course of debugging why a particular server required increasing
max_locks_per_transation, I found a peculiar behavior.  If you do an
UPDATE which doesn't match any CE constraint on the parent table in an
inheritance chain, you get a RowExclusiveLock on every partition and
every index on every partition.  However, these rowexclusivelocks have
no page or tuple reference; it's a RowExclusiveLock with no row.

Is this intentional?

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

Re: Strange behavior with pg_locks and partitioning

От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Fri, Jun 15, 2012 at 12:42 PM, Josh Berkus  wrote:
> In the course of debugging why a particular server required increasing
> max_locks_per_transation, I found a peculiar behavior.  If you do an
> UPDATE which doesn't match any CE constraint on the parent table in an
> inheritance chain, you get a RowExclusiveLock on every partition and
> every index on every partition.  However, these rowexclusivelocks have
> no page or tuple reference; it's a RowExclusiveLock with no row.
>
> Is this intentional?

RowExclusiveLock is a type of table lock, not a lock on a row.

You're going to get that on all tables (and their indexes) involved in
any write query.

So it sounds unsurprising to me.

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

Re: Strange behavior with pg_locks and partitioning

От:
Josh Berkus <josh@agliodbs.com>
Дата:
> So it sounds unsurprising to me.

OK, I'll just submit a note for the docs for max_locks_per_transaction,
then.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

FAQ