On Fri, Sep 30, 2022 at 5:20 PM Andres Freund <and...@anarazel.de> wrote: > I think it'd be an OK tradeoff to optimize WAL usage for a few of the worst to > pay off for 56bit relfilenodes. The class of problems foreclosed is large > enough to "waste" "improvement potential" on this.
I agree overall. A closely related but distinct question occurs to me: if we're going to be "wasting" space on alignment padding in certain cases one way or another, can we at least recognize those cases and take advantage at the level of individual WAL record formats? In other words: So far we've been discussing the importance of not going over a critical threshold for certain WAL records. But it might also be valuable to consider recognizing that that's inevitable, and that we might as well make the most of it by including one or two other things. This seems most likely to matter when managing the problem of negative compression with per-WAL-record compression schemes for things like arrays of page offset numbers [1]. If (say) a given compression scheme "wastes" space for arrays of only 1-3 items, but we already know that the relevant space will all be lost to alignment needed by code one level down in any case, does it really count as waste? We're likely always going to have some kind of negative compression, but you do get to influence where and when the negative compression happens. Not sure how relevant this will turn out to be, but seems worth considering. More generally, thinking about how things work across multiple layers of abstraction seems like it could be valuable in other ways. [1] https://postgr.es/m/CAH2-WzmLCn2Hx9tQLdmdb+9CkHKLyWD2bsz=pmrebc4daxj...@mail.gmail.com -- Peter Geoghegan