Re: [HACKERS] Proposal: Local indexes for partitioned table
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>, Maksim Milyutin <milyutinma@gmail.com>
Date: 2017-11-13T17:06:46Z
Lists: pgsql-hackers
Attachments
Here's a third iteration of this work; I've polished a few rough edges and made sure that the behavior on ALTER TABLE ATTACH is consistent with what you get when creating a new partition via CREATE TABLE .. PARTITION OF, and with what happens when you do CREATE INDEX on an existing partitioning tree, and added some docs. The main big item missing is the CONCURRENTLY option to CREATE INDEX. With that and once I review a couple of minor items marked XXX, I'm about to call committable. I also added ONLY to create index: "CREATE INDEX .. ON ONLY tab". Normally if you create an index on a partitioned table, it recurses; with this option, it doesn't. This is used by pg_dump to ensure that restore doesn't create indexes on partitions that didn't have them on the original database. Then the others are attached using the new command ALTER INDEX ATTACH, as discussed. For symmetry there's also ALTER INDEX DETACH. Can be used to replace an index on a partition with a fresh version, for cases of bloat. The last patch is in WIP state yet, and mostly untouched since I last posted it. It allows creation of unique constraints (and PKs). But any interaction with the rest of the system is untested (such as FKs, ON CONFLICT, etc). -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Local partitioned indexes
- 8b08f7d4820f 11.0 landed
-
Fix StoreCatalogInheritance1 to use 32bit inhseqno
- 1ef61ddce908 11.0 landed
- 9a215fb4b5ec 9.3.21 landed
- 8a71ee628854 9.6.7 landed
- 61f08c016322 10.2 landed
- 1284d18b5de9 9.4.16 landed
- 0d993709a773 9.5.11 landed
-
Get rid of copy_partition_key
- 8a0596cb656e 11.0 landed
-
Simplify index_[constraint_]create API
- a61f5ab98638 11.0 landed