pgsql: Delete empty pages in each pass during GIST VACUUM.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pgsql: Delete empty pages in each pass during GIST VACUUM.

Amit Kapila-3
Delete empty pages in each pass during GIST VACUUM.

Earlier, we use to postpone deleting empty pages till the second stage of
vacuum to amortize the cost of scanning internal pages.  However, that can
sometimes (say vacuum is canceled or errored between first and second
stage) delay the pages to be recycled.

Another thing is that to facilitate deleting empty pages in the second
stage, we need to share the information about internal and empty pages
between different stages of vacuum.  It will be quite tricky to share this
information via DSM which is required for the upcoming parallel vacuum
patch.

Also, it will bring the logic to reclaim deleted pages closer to nbtree
where we delete empty pages in each pass.

Overall, the advantages of deleting empty pages in each pass outweigh the
advantages of postponing the same.

Author: Dilip Kumar, with changes by Amit Kapila
Reviewed-by: Sawada Masahiko and Amit Kapila
Discussion: https://postgr.es/m/CAA4eK1LGr+MN0xHZpJ2dfS8QNQ1a_aROKowZB+MPNep8FVtwAA@...

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4e514c6180fbf71cf7a0171867c828c63afd1c37

Modified Files
--------------
src/backend/access/gist/README       |  23 +++--
src/backend/access/gist/gistvacuum.c | 160 +++++++++++++++--------------------
2 files changed, 78 insertions(+), 105 deletions(-)