Re: Speed up pg_checksums in cases where checksum already set

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Justin Pryzby <pryzby(at)telsasoft(dot)com>
Subject: Re: Speed up pg_checksums in cases where checksum already set
Date: 2021-06-19 00:01:17
Message-ID: CAKAnmmKhxLgEUFHEOrw06W+=NAVvZvR6-L+qybneZj8bjxmg=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 18, 2021 at 1:57 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> This doc addition is a bit confusing, as it could mean that each file
> has just one single checksum. We could be more precise, say:
> "When enabling checksums, each relation file block with a changed
> checksum is rewritten in place."
>

Agreed, I like that wording. New patch attached.

> Should we also mention that the sync happens even if no blocks are
> rewritten based on the reasoning of upthread (aka we'd better do the
> final flush as an interrupted pg_checksums may let a portion of the
> files as not flushed)?
>

I don't know that we need to bother: the default is already to sync and one
has to go out of one's way using the -N argument to NOT sync, so I think
it's a pretty safe assumption to everyone (except those who read my first
version of my patch!) that syncing always happens.

Cheers,
Greg

Attachment Content-Type Size
003.pg_checksums.optimize.writes.and.always.sync.patch application/octet-stream 2.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2021-06-19 00:03:45 Re: Optionally automatically disable logical replication subscriptions on error
Previous Message Thomas Munro 2021-06-18 23:59:16 Re: pgbench logging broken by time logic changes