Re: ALTER TABLE SET STATISTICS requires AccessExclusiveLock - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ALTER TABLE SET STATISTICS requires AccessExclusiveLock
Date
Msg-id 12734.1279473625@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER TABLE SET STATISTICS requires AccessExclusiveLock  (Andres Freund <andres@anarazel.de>)
Responses Re: ALTER TABLE SET STATISTICS requires AccessExclusiveLock
Re: ALTER TABLE SET STATISTICS requires AccessExclusiveLock
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On Sunday 18 July 2010 18:02:26 Simon Riggs wrote:
>> Then I think the fix is to look at the xmin values on all of the tables
>> used during planning and ensure that we only use constraint-based
>> optimisations in a serializable transaction when our top xmin is later
>> than the last DDL change (via its xmin).

> Why not just use a the normal snapshot at that point?

There isn't a "normal snapshot" that the planner should be relying on.
It doesn't know what snap the resulting plan will be used with.

I'm unconvinced that this is a problem worth worrying about, but if it
is then Simon's probably got the right idea: check the xmin of a
pg_constraint row before depending on it for planning.  Compare the
handling of indexes made with CREATE INDEX CONCURRENTLY.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Review: Row-level Locks & SERIALIZABLE transactions, postgres vs. Oracle
Next
From: Andrew Dunstan
Date:
Subject: Re: Review: Row-level Locks & SERIALIZABLE transactions, postgres vs. Oracle