Re: [HACKERS] [PATCH] Vacuum: Update FSM more frequently
Claudio Freire <klaussfreire@gmail.com>
From: Claudio Freire <klaussfreire@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: PostgreSQL-Dev <pgsql-hackers@postgresql.org>
Date: 2018-02-27T15:06:04Z
Lists: pgsql-hackers
Attachments
- 0001-Vacuum-Update-FSM-more-frequently-v7.patch (text/x-patch) patch v7-0001
- 0002-Vacuum-do-a-partial-FSM-vacuum-at-the-beginning-v4.patch (text/x-patch) patch v4-0002
- 0003-FSM-Fix-relation-extension-FSM-update-v2.patch (text/x-patch) patch v2-0003
On Mon, Feb 26, 2018 at 10:20 PM, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
> Thank you for updating patches!
>
> 0001 patch looks good to me except for the following unnecessary empty lines.
>
> + * If there are no indexes then we should periodically
> vacuum the FSM
> + * on huge relations to make free space visible early.
> + */
> + else if (nindexes == 0 && fsm_updated_pages >
> vacuum_fsm_every_pages)
> + {
> + /* Vacuum the Free Space Map */
> + FreeSpaceMapVacuum(onerel, max_freespace);
> + fsm_updated_pages = 0;
> + max_freespace = 0;
> + }
> +
> +
> + /*
>
> @@ -913,10 +967,14 @@ lazy_scan_heap(Relation onerel, int options,
> LVRelStats *vacrelstats,
>
> vmbuffer, InvalidTransactionId,
>
> VISIBILITYMAP_ALL_VISIBLE | VISIBILITYMAP_ALL_FROZEN);
> END_CRIT_SECTION();
> +
> }
>
> 0002 patch looks good to me.
>
> For 0003 patch, I think fsm_set() function name could lead misreading
> because it actually not only sets the value but also returns the
> value. fsm_set_and_get() might be better?
Attached is the patchset modified as requested
Commits
-
Do index FSM vacuuming sooner.
- c79f6df75dd3 11.0 landed
-
Remove UpdateFreeSpaceMap(), use FreeSpaceMapVacuumRange() instead.
- a063baaced27 11.0 landed
-
While vacuuming a large table, update upper-level FSM data every so often.
- 851a26e26637 11.0 landed
-
Simplify autovacuum work-item implementation
- 31ae1638ce35 11.0 cited