Re: [HACKERS] GUC for cleanup indexes threshold.
Alexander Korotkov <a.korotkov@postgrespro.ru>
From: Alexander Korotkov <a.korotkov@postgrespro.ru>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Simon Riggs <simon@2ndquadrant.com>, Kyotaro HORIGUCHI <horiguchi.kyotaro@lab.ntt.co.jp>,
Yura Sokolov <y.sokolov@postgrespro.ru>, Peter Geoghegan <pg@bowt.ie>, Andres Freund <andres@anarazel.de>,
Robert Haas <robertmhaas@gmail.com>, David Steele <david@pgmasters.net>, Amit Kapila <amit.kapila16@gmail.com>, "Ideriha, Takeshi" <ideriha.takeshi@jp.fujitsu.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>,
Kuntal Ghosh <kuntalghosh.2007@gmail.com>, pgsql-hackers-owner@postgresql.org
Date: 2018-03-03T23:59:19Z
Lists: pgsql-hackers
On Fri, Mar 2, 2018 at 10:53 AM, Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > 2) In the append-only case, index statistics can lag indefinitely. > > The original proposal proposed a new GUC that specifies a fraction of > the modified pages to trigger a cleanup indexes. Regarding original proposal, I didn't get what exactly it's intended to be. You're checking if vacuumed_pages >= nblocks * vacuum_cleanup_index_scale. But vacuumed_pages is the variable which could be incremented when no indexes exist on the table. When indexes are present, this variable is always zero. I can assume, that it's intended to compare number of pages where at least one tuple is deleted to nblocks * vacuum_cleanup_index_scale. But that is also not an option for us, because we're going to optimize the case when exactly zero tuples is deleted by vacuum. The thing I'm going to propose is to add estimated number of tuples in table to IndexVacuumInfo. Then B-tree can memorize that number of tuples when last time index was scanned in the meta-page. If pass value is differs from the value in meta-page too much, then cleanup is forced. Any better ideas? ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company
Commits
-
Fix upper limit for vacuum_cleanup_index_scale_factor
- 4d54543efa5e 11.0 landed
-
Increase upper limit for vacuum_cleanup_index_scale_factor
- 6ca33a885bf8 11.0 landed
-
Fixes for vacuum_cleanup_index_scale_factor GUC option
- 9a994e37e08d 11.0 landed
-
Skip full index scan during cleanup of B-tree indexes when possible
- 857f9c36cda5 11.0 landed