Re: ATTACH/DETACH PARTITION CONCURRENTLY
David Rowley <david.rowley@2ndquadrant.com>
From: David Rowley <david.rowley@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>,
Andres Freund <andres@anarazel.de>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Simon Riggs <simon@2ndquadrant.com>
Date: 2018-11-08T20:59:36Z
Lists: pgsql-hackers
On 9 November 2018 at 05:34, Robert Haas <robertmhaas@gmail.com> wrote: > I suspect the only good way of fixing this problem is using a single > snapshot to perform both the scan of pg_inherits and the subsequent > pg_class lookups. That way, you know that you are seeing the state of > the whole partitioning hierarchy as it existed at some particular > point in time -- every commit is either fully reflected in the > constructed PartitionDesc or not reflected at all. Unfortunately, > that would mean that we can't use the syscache to perform the lookups, > which might have unhappy performance consequences. I do have a patch sitting around that moves the relpartbound into a new catalogue table named pg_partition. This gets rid of the usage of pg_inherits for partitioned tables. I wonder if that problem is easier to solve with that. It also solves the issue with long partition keys and lack of toast table on pg_class. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Allow ATTACH PARTITION with only ShareUpdateExclusiveLock.
- 898e5e3290a7 12.0 landed
-
Change lock acquisition order in expand_inherited_rtentry.
- f4b6341d5fcb 12.0 landed
-
Move code for managing PartitionDescs into a new file, partdesc.c
- 1bb5e7821810 12.0 landed
-
Remove more redundant relation locking during executor startup.
- f2343653f5b2 12.0 cited
-
Add assertions that we hold some relevant lock during relation open.
- b04aeb0a053e 12.0 cited
-
Try to acquire relation locks in RangeVarGetRelid.
- 4240e429d0c2 9.2.0 cited