Re: VACUUM (DISABLE_PAGE_SKIPPING on)

From: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: VACUUM (DISABLE_PAGE_SKIPPING on)
Date: 2020-11-16 22:52:48
Message-ID: CAD21AoA-HnOwSNvE=DL+6+yLT_hdHSOyGTbkYez6wdGcPtu3jQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 17, 2020 at 5:52 AM Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
>
> The docs are misleading for this feature, since they say:
> "This option disables all page-skipping behavior, and is
> intended to be used only when the contents of the visibility map are
> suspect, which should happen only if there is a hardware or software
> issue causing database corruption."
>
> The docs do correctly say "Pages where all tuples are known to be
> frozen can always be skipped". Checking the code, lazy_scan_heap()
> comments say
> "we can still skip pages that are all-frozen, since such pages do not
> need freezing".
>
> The code is quite clear: DISABLE_PAGE_SKIPPING makes the vacuum into
> an aggressive vacuum. Line 487, heap_vacuum_rel(). Aggressive vacuums
> can still skip a page that is frozen, and rely on the visibility map
> for that information.
>
> So the docs are wrong - we don't disable *all* page-skipping and it is
> not appropriate to warn users away from this feature by saying "is
> intended to be used only when the contents of the visibility map are
> suspect".

I don't think the doc is wrong. If DISABLE_PAGE_SKIPPING is specified,
we not only set aggressive = true but also skip checking visibility
map. For instance, see line 905 and line 963, lazy_scan_heap().

Regards,

--
Masahiko Sawada
EnterpriseDB: https://www.enterprisedb.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2020-11-16 23:29:19 Re: PATCH: Batch/pipelining support for libpq
Previous Message Thomas Munro 2020-11-16 22:42:53 Re: Cache relation sizes?