pgsql: Optimize pg_checksums --enable where checksum is already set

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Optimize pg_checksums --enable where checksum is already set
Date: 2021-06-30 00:59:39
Message-ID: E1lyOZn-0003jB-79@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Optimize pg_checksums --enable where checksum is already set

This commit prevents pg_checksums to do a rewrite of a block if it has
no need to, in the case where the computed checksum matches with what's
already stored in the block read. This is helpful to accelerate
successive runs of the tool when the previous ones got interrupted, for
example.

The number of blocks and files written is tracked and reported by the
tool once finished. Note that the final flush of the data folder
happens even if no blocks are written, as it could be possible that a
previous interrupted run got stopped while doing a flush.

Author: Greg Sabino Mullane
Reviewed-by: Paquier Michael, Julien Rouhaud
Discussion: https://postgr.es/m/CAKAnmmL+k6goxmVzQJB+0bAR0PN1sgo6GDUXJhyhUmVMze1QAw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4c9f50d116461617848601e97dbc6f122b0a6f14

Modified Files
--------------
doc/src/sgml/ref/pg_checksums.sgml | 3 ++-
src/bin/pg_checksums/pg_checksums.c | 36 ++++++++++++++++++++++++++++++------
2 files changed, 32 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2021-06-30 02:51:05 pgsql: Fix incorrect PITR message for transaction ROLLBACK PREPARED
Previous Message Alexander Korotkov 2021-06-29 20:19:20 pgsql: Fixes for multirange selectivity estimation