Re: New statistics for tuning WAL buffer size

From: Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, tsunakawa(dot)takay(at)fujitsu(dot)com
Subject: Re: New statistics for tuning WAL buffer size
Date: 2020-09-02 09:56:17
Message-ID: 8066eb5412b580e07db0f29611d6e909@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> +/* ----------
> + * Backend types
> + * ----------
>
> You seem to forget to add "*/" into the above comment.
> This issue could cause the following compiler warning.
> ../../src/include/pgstat.h:761:1: warning: '/*' within block comment
> [-Wcomment]

Thanks for the comment. I fixed.

> The contents of pg_stat_walwrites are reset when the server
> is restarted. Isn't this problematic? IMO since pg_stat_walwrites
> is a collected statistics view, basically its contents should be
> kept even in the case of server restart.

I agree your opinion.
I modified to use the statistics collector and persist the wal
statistics.

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.

The pg_stat_walwriter is not security restricted now, so ordinary users
can access it.
I has the same security level as pg_stat_archiver.If you have any
comments, please let me know.

Regards,
--
Masahiro Ikeda
NTT DATA CORPORATION

Attachment Content-Type Size
0003_pg_stat_walwriter_view.patch text/x-diff 18.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2020-09-02 10:11:25 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Previous Message Amit Kapila 2020-09-02 08:49:00 Re: [Patch] Optimize dropping of relation buffers using dlist