pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix missing FSM vacuum opportunities on tables without indexes.
3+ messages / 1 participants
[nested] [flat]

* pgsql: Fix missing FSM vacuum opportunities on tables without indexes.
@ 2025-07-02 06:27 Masahiko Sawada <msawada@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Masahiko Sawada @ 2025-07-02 06:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix missing FSM vacuum opportunities on tables without indexes.

Commit c120550edb86 optimized the vacuuming of relations without
indexes (a.k.a. one-pass strategy) by directly marking dead item IDs
as LP_UNUSED. However, the periodic FSM vacuum was still checking if
dead item IDs had been marked as LP_DEAD when attempting to vacuum the
FSM every VACUUM_FSM_EVERY_PAGES blocks. This condition was never met
due to the optimization, resulting in missed FSM vacuum
opportunities.

This commit modifies the periodic FSM vacuum condition to use the
number of tuples deleted during HOT pruning. This count includes items
marked as either LP_UNUSED or LP_REDIRECT, both of which are expected
to result in new free space to report.

Back-patch to v17 where the vacuum optimization for tables with no
indexes was introduced.

Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/CAD21AoBL8m6B9GSzQfYxVaEgvD7-Kr3AJaS-hJPHC+avm-29zw@mail.gmail.com
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/792238c8b4a1943e91485fa7dac1959f23a9ac1d

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix missing FSM vacuum opportunities on tables without indexes.
@ 2025-07-02 06:27 Masahiko Sawada <msawada@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Masahiko Sawada @ 2025-07-02 06:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix missing FSM vacuum opportunities on tables without indexes.

Commit c120550edb86 optimized the vacuuming of relations without
indexes (a.k.a. one-pass strategy) by directly marking dead item IDs
as LP_UNUSED. However, the periodic FSM vacuum was still checking if
dead item IDs had been marked as LP_DEAD when attempting to vacuum the
FSM every VACUUM_FSM_EVERY_PAGES blocks. This condition was never met
due to the optimization, resulting in missed FSM vacuum
opportunities.

This commit modifies the periodic FSM vacuum condition to use the
number of tuples deleted during HOT pruning. This count includes items
marked as either LP_UNUSED or LP_REDIRECT, both of which are expected
to result in new free space to report.

Back-patch to v17 where the vacuum optimization for tables with no
indexes was introduced.

Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/CAD21AoBL8m6B9GSzQfYxVaEgvD7-Kr3AJaS-hJPHC+avm-29zw@mail.gmail.com
Backpatch-through: 17

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7c6ededac82baa0c334c11a36addd48522ec433d

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: Fix missing FSM vacuum opportunities on tables without indexes.
@ 2025-07-02 06:27 Masahiko Sawada <msawada@postgresql.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Masahiko Sawada @ 2025-07-02 06:27 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix missing FSM vacuum opportunities on tables without indexes.

Commit c120550edb86 optimized the vacuuming of relations without
indexes (a.k.a. one-pass strategy) by directly marking dead item IDs
as LP_UNUSED. However, the periodic FSM vacuum was still checking if
dead item IDs had been marked as LP_DEAD when attempting to vacuum the
FSM every VACUUM_FSM_EVERY_PAGES blocks. This condition was never met
due to the optimization, resulting in missed FSM vacuum
opportunities.

This commit modifies the periodic FSM vacuum condition to use the
number of tuples deleted during HOT pruning. This count includes items
marked as either LP_UNUSED or LP_REDIRECT, both of which are expected
to result in new free space to report.

Back-patch to v17 where the vacuum optimization for tables with no
indexes was introduced.

Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/CAD21AoBL8m6B9GSzQfYxVaEgvD7-Kr3AJaS-hJPHC+avm-29zw@mail.gmail.com
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3811ca3600a31f999e4709de4a9c64c789992e14

Modified Files
--------------
src/backend/access/heap/vacuumlazy.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-07-02 06:27 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-07-02 06:27 pgsql: Fix missing FSM vacuum opportunities on tables without indexes. Masahiko Sawada <msawada@postgresql.org>
2025-07-02 06:27 pgsql: Fix missing FSM vacuum opportunities on tables without indexes. Masahiko Sawada <msawada@postgresql.org>
2025-07-02 06:27 pgsql: Fix missing FSM vacuum opportunities on tables without indexes. Masahiko Sawada <msawada@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox