Skip site navigation (1) Skip section navigation (2)

Re: improving foreign key locks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Florian Pflug <fgp(at)phlo(dot)org>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: improving foreign key locks
Date: 2010-12-01 17:44:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Florian Pflug <fgp(at)phlo(dot)org> writes:
> On Dec1, 2010, at 17:17 , Tom Lane wrote:
>> There's not enough space in the infomask to record which columns (or
>> which unique index) are involved.  And if you're talking about data that
>> could remain on disk long after the unique index is gone, that's not
>> going to be good enough.

> We'd distinguish two cases
>   A) The set of locked columns is a subset of the set of columns mentioned in
>      *any* unique index. (In other words, for every locked column there is a
>      unique index which includes that column, though not necessarily one index
>      which includes them all)
>   B) The set of locked columns does not satisfy (A)

How's that fix it?  The on-disk flags are still falsifiable by
subsequent index changes.

> Creating indices shouldn't pose a problem, since it would only enlarge the set of locked columns for rows with HEAP_XMAX_SHARED_LOCK_KEY set.

Not with that definition.  I could create a unique index that doesn't
contain some column that every previous unique index contained.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Ana Carolina Brito de AlmeidaDate: 2010-12-01 17:48:40
Subject: Hypothetical Indexes - PostgreSQL extension - PGCON 2010
Previous:From: Robert HaasDate: 2010-12-01 17:31:36
Subject: Re: crash-safe visibility map, take three

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group