Re: smgrzeroextend clarification - Mailing list pgsql-hackers

From Andres Freund
Subject Re: smgrzeroextend clarification
Date
Msg-id EDFBDEDD-4BC4-4CD9-B2C7-F721FF4D0BE7@anarazel.de
Whole thread Raw
In response to Re: smgrzeroextend clarification  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
Hi,

On May 12, 2023 11:36:23 AM PDT, Thomas Munro <thomas.munro@gmail.com> wrote:
>Just a thought: should RelationCopyStorageUsingBuffer(), the new code
>used by CREATE DATABASE with the default strategy WAL_LOG, use the
>newer interface so that it creates fully allocated files instead of
>sparse ones?

I played with that, but at least on Linux with ext4 and xfs it was hard to find cases where it really was beneficial.
That'sactually how I ended up finding the issues I'd fixed recently-ish. 

I think it might be different if we had an option to not use a strategy for the target database - right now we IIRC
writeback due to ring replacement. Entirely or largely in order, which I think removes most of the issues you could
have.

One issue is that it'd be worse on platforms / filesystems without fallocate support, because we would write the data
backtwice (once with zeros, once the real data). Perhaps we should add a separate parameter controlling the fallback
behaviour.

Andres

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Large files for relations
Next
From: Stephen Frost
Date:
Subject: Re: [PATCHES] Post-special page storage TDE support