Re: New statistics for tuning WAL buffer size

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: New statistics for tuning WAL buffer size
Date: 2020-09-05 09:40:51
Message-ID: CABUevEwLk3on-P1AtpoREqrpLoxN6kD+DbeMOVGWCR_BXXXMbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Sep 4, 2020 at 5:42 AM Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
wrote:

>
>
> On 2020/09/04 11:50, tsunakawa(dot)takay(at)fujitsu(dot)com wrote:
> > From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
> >>> I changed the view name from pg_stat_walwrites to pg_stat_walwriter.
> >>> I think it is better to match naming scheme with other views like
> >> pg_stat_bgwriter,
> >>> which is for bgwriter statistics but it has the statistics related to
> backend.
> >>
> >> I prefer the view name pg_stat_walwriter for the consistency with
> >> other view names. But we also have pg_stat_wal_receiver. Which
> >> makes me think that maybe pg_stat_wal_writer is better for
> >> the consistency. Thought? IMO either of them works for me.
> >> I'd like to hear more opinons about this.
> >
> > I think pg_stat_bgwriter is now a misnomer, because it contains the
> backends' activity. Likewise, pg_stat_walwriter leads to misunderstanding
> because its information is not limited to WAL writer.
> >
> > How about simply pg_stat_wal? In the future, we may want to include WAL
> reads in this view, e.g. reading undo logs in zheap.
>
> Sounds reasonable.
>

+1.

pg_stat_bgwriter has had the "wrong name" for quite some time now -- it
became even more apparent when the checkpointer was split out to it's own
process, and that's not exactly a recent change. And it had allocs in it
from day one...

I think naming it for what the data in it is ("wal") rather than which
process deals with it ("walwriter") is correct, unless the statistics can
be known to only *ever* affect one type of process. (And then different
processes can affect different columns in the view). As a general rule --
and that's from what I can tell exactly what's being proposed.

--
Magnus Hagander
Me: https://www.hagander.net/ <http://www.hagander.net/>
Work: https://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-09-05 10:32:23 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Previous Message Julien Rouhaud 2020-09-05 06:55:06 Re: Use <unnamed> for name of unnamed portal's memory context