Reduce WAL generated when copying relation storage RelationCopyStorage() treated every page as nonstandard, logging the region between pd_lower and pd_upper in full-page images even when it was known to be free space.
Apply the same policy that db26517e79c established for RelationCopyStorageUsingBuffer(): omit that region for heap and B-tree main-fork pages, which are known to use the standard page layout. For other pages, omit it only if the bounds are valid and the region contains only zeroes. This reduces WAL volume without losing data on pages with nonstandard layouts. Author: Melanie Plageman <[email protected]> Reviewed-by: surya poondla <[email protected]> Discussion: https://postgr.es/m/CAAKRu_b9r-Pz9gzYvC%2B5EHnXqNgfsJhcH%3DhuUGbXzvcnbHtxCg%40mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/ecb260853526019a1340ba8a6b4c6de27a07d69b Modified Files -------------- src/backend/access/heap/heapam_handler.c | 11 ++++++++--- src/backend/catalog/storage.c | 20 +++++++++++++++----- src/backend/commands/tablecmds.c | 11 ++++++++--- src/include/catalog/storage.h | 3 ++- src/test/recovery/t/018_wal_optimize.pl | 13 +++++++++++++ 5 files changed, 46 insertions(+), 12 deletions(-)
