Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Call lazy_check_wraparound_failsafe earlier for parallel vacuum
Date: 2022-12-22 18:43:46
Message-ID: CAH2-Wzm=YnEXTBtdC5+YcWOdHVVXvkoUNZZk9163dCjXcET66A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 20, 2022 at 9:44 AM Imseih (AWS), Sami <simseih(at)amazon(dot)com> wrote:
> Attached is a patch to check scanned pages rather
> than blockno.

Pushed, thanks!

I adjusted the FAILSAFE_EVERY_PAGES comments, which now point out that
FAILSAFE_EVERY_PAGES is a power-of-two. The implication is that the
compiler is all but guaranteed to be able to reduce the modulo
division into a shift in the lazy_scan_heap loop, at the point of the
failsafe check. I doubt that it would really matter if the compiler
had to generate a DIV instruction, but it seems like a good idea to
avoid it on general principle, at least in performance sensitive code.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikita Malakhov 2022-12-22 18:45:35 Re: ARRNELEMS Out-of-bounds possible errors
Previous Message Nikita Malakhov 2022-12-22 18:07:31 Re: [PATCH] Infinite loop while acquiring new TOAST Oid