From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Make gistvacuumcleanup() count the actual number of index tuples |
Date: | 2018-03-02 16:22:59 |
Message-ID: | [email protected] |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Make gistvacuumcleanup() count the actual number of index tuples.
Previously, it just returned the heap tuple count, which might be only an
estimate, and would be completely the wrong thing if the index is partial.
Since this function scans every index page anyway to find free pages,
it's practically free to count the surviving index tuples. Let's do that
and return an accurate count.
This is easily visible as a wrong reltuples value for a partial GiST
index following VACUUM, so back-patch to all supported branches.
Andrey Borodin, reviewed by Michail Nikolaev
Discussion: https://postgr.es/m/[email protected]
Branch
------
REL9_5_STABLE
Modified Files
--------------
src/backend/access/gist/gistvacuum.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Fujii Masao | 2018-03-02 16:42:17 | pgsql: Improve tab-completion for ALTER INDEX RESET/SET. |
Previous Message | Magnus Hagander | 2018-03-02 11:42:32 | pgsql: Fix msvc builds for ActivePerl > 5.24 |