Hi hackers!
Here is the patch that deletes pages during GiST VACUUM.
> 12 нояб. 2017 г., в 23:20, Andrey Borodin <x4mmm@yandex-team.ru> написал(а):
>
> If author and community do not object, I want to continue work on Konstantin's patch.
==Purpose==
Long story short, some time ago Konstantin Kuznetsov hacked out a patch that added GiST scan with physical order of
scan.
This scan is using a lot of memory to build map of whole GiST graph. If there is not enough maintenance memory, patch
hadthe fallback to old GiST VACUUM.
New behavior was deleting pages while old (still used) was not.
I've rebased patch, fixed some bugs and decided that it solves too much in a single step.
Here is the patch, which adds functionality of GiST page deletes.
If this is committed, porting physical scan code will be much easier.
==What is changed==
When GiST VACUUM scans graph for removed tuples, it remembers internal pages that are referencing completely empty leaf
pages.
Then in additional step, these pages are rescanned to delete references and mark leaf pages as free.
==Limitations==
At least one reference on each internal pages is left undeleted to preserve balancing of the tree.
Pages that has FOLLOW-RIGHT flag also are not deleted, even if empty.
Thank you for your attention, any thoughts are welcome.
Best regards, Andrey Borodin.