Re: Proposal: Local indexes for partitioned table
Maksim Milyutin <m.milyutin@postgrespro.ru>
From: Maksim Milyutin <m.milyutin@postgrespro.ru>
To: Greg Stark <stark@mit.edu>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>,
Robert Haas <robertmhaas@gmail.com>
Date: 2017-04-10T11:32:11Z
Lists: pgsql-hackers
On 10.04.2017 13:46, Greg Stark wrote: > On 4 April 2017 at 17:10, Maksim Milyutin <m.milyutin@postgrespro.ru> wrote: >> >> 3. As I noticed early pg_depend table is used for cascade deleting indexes >> on partitioned table and its children. I also use pg_depend to determine >> relationship between parent and child indexes when reindex executes >> recursively on child indexes. >> >> Perhaps, it's not good way to use pg_depend to determine the relationship >> between parent and child indexes because the kind of this relationship is >> not defined. I could propose to add into pg_index table specific field of >> 'oidvector' type that specify oids of dependent indexes for the current >> local index. > > > Alternately you could have an single oid in pg_index on each of the > children that specifies which local index is its parent. That would > probably require a new index on that column so you could look up all > the children efficiently. > > I think it would behave more sensibly when you're adding or removing a > partition, especially if you want to add many partitions in parallel > using multiple transactions. An oidvector of children would > effectively mean you could only be doing one partition creation or > deletion at a time. > Thanks for your comment. Your approach sounds better than mine. I'll try it. -- Maksim Milyutin Postgres Professional: http://www.postgrespro.com Russian Postgres Company
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