On Fri, Nov 18, 2022 at 3:31 AM Cary Huang <cary.hu...@highgo.ca> wrote: > > Patch: Global Unique Index > - Optimizer, query planning and vacuum - > Since no major modification is done on global unique index's structure and > storage, it works in the same way as a regular partitioned index. No major > change is required to be done on optimizer, planner and vacuum process as > they should work in the same way as regular index.
It might not need changes in the vacuum to make it work. But this can not be really useful without modifying the vacuum the way it works. I mean currently, the indexes are also partitioned based on the table so whenever we do table vacuum it's fine to do index vacuum but now you will have one gigantic index and which will be vacuumed every time we vacuum any of the partitions. So for example, if you have 10000 partitions then by the time you vacuum the whole table (all 10000 partitions) the global index will be vacuumed 10000 times. There was some effort in past (though it was not concluded) about decoupling the index and heap vacuuming such that instead of doing the index vacuum for each partition we remember the dead tids and we only do the index vacuum when we think there are enough dead items so that the index vacuum makes sense[1]. [1] https://www.postgresql.org/message-id/CA%2BTgmoZgapzekbTqdBrcH8O8Yifi10_nB7uWLB8ajAhGL21M6A%40mail.gmail.com -- Regards, Dilip Kumar EnterpriseDB: http://www.enterprisedb.com