Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access) - Mailing list pgsql-hackers

From Dagfinn Ilmari Mannsåker
Subject Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Date
Msg-id 87see87fnq.fsf@wibble.ilmari.org
Whole thread Raw
In response to eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)  (Melanie Plageman <melanieplageman@gmail.com>)
Responses Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)
List pgsql-hackers
Melanie Plageman <melanieplageman@gmail.com> writes:

> +            PruneFreezeParams params = {.relation = relation,.buffer = buffer,
> +                .reason = PRUNE_ON_ACCESS,.options = 0,
> +                .vistest = vistest,.cutoffs = NULL
> +            };

I didn't pay much attention to this thread, so I didn't notice this
until it got committed, but I'd like to lodge an objection to this
formatting, especially the lack of spaces before the field names. This
would be much more readable with one struct field per line, i.e.

    PruneFreezeParams params = {
        .relation = rel,
                .buffer = buf,
        .reason = PRUNE_VACUUM_SCAN,
        .options = HEAP_PAGE_PRUNE_FREEZE,
        .vistest = vacrel->vistest,
        .cutoffs = &vacrel->cutoffs,
    };

or at a pinch, if we're really being stingy with the vertical space:

    PruneFreezeParams params = {
        .relation = rel, .buffer = buf,
                .reason = PRUNE_VACUUM_SCAN, .options = HEAP_PAGE_PRUNE_FREEZE,
        .vistest = vacrel->vistest, .cutoffs = &vacrel->cutoffs,
    };

I had a quick grep, and every other designated struct initialiser I
could find uses the one-field-per-line form, but they're not consistent
about the comma after the last field.  I personally prefer having it, so
that one can add more fields later without having to modify the
unrelated line.

- ilmari



pgsql-hackers by date:

Previous
From: Ayush Vatsa
Date:
Subject: Re: Clarification on when _PG_init() is invoked for extensions
Next
From: Dagfinn Ilmari Mannsåker
Date:
Subject: Re: eliminate xl_heap_visible to reduce WAL (and eventually set VM on-access)