Re: New gist vacuum. - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: New gist vacuum.
Date
Msg-id 8548498B-6EC6-4C89-8313-107BEC437489@yandex-team.ru
Whole thread Raw
In response to Re: [HACKERS] New gist vacuum.  (Andrey Borodin <x4mmm@yandex-team.ru>)
Responses Re: New gist vacuum.  (Andrey Borodin <x4mmm@yandex-team.ru>)
List pgsql-hackers
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.

Attachment

pgsql-hackers by date:

Previous
From: Yugo Nagata
Date:
Subject: Re: [HACKERS] [PATCH] Lockable views
Next
From: Андрей Жиденков
Date:
Subject: Notes about Pl/PgSQL assignment performance