public inbox for [email protected]
help / color / mirror / Atom feedFrom: Sam Stearns <[email protected]>
To: [email protected] <[email protected]>
Cc: Fabrice Chapuis <[email protected]>
Cc: Laurenz Albe <[email protected]>
Cc: Ron Johnson <[email protected]>
Cc: Pgsql-admin <[email protected]>
Cc: Henry Ashu <[email protected]>
Subject: Re: Re: Postgres Parameters
Date: Wed, 12 Nov 2025 07:12:16 -0800
Message-ID: <CAN6TVjndnx18mPT2aU4c+rG1X=vLb8eZF5WAF4dXGOTHrgB1Gg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAN6TVj=QOuZDGdZegGN1ac0GPM7DgoYMBAWOJHLM68KprMAW1Q@mail.gmail.com>
<CAA5-nLBPuxwQdZ0mFNMTP9kyQ+b9qY9PYKKWf=Q+SRxJS1iiKg@mail.gmail.com>
<CAN6TVjmO7Tqd1RKqcjrD2LFFcrmSThx+CNuhjWKNHSGO6HVNEQ@mail.gmail.com>
<[email protected]>
Thank you, Zhenwei.
On Tue, Nov 11, 2025 at 6:26 PM [email protected] <
[email protected]> wrote:
> I found that PostgreSQL 15. 3 doesn't support the pg_stat_checkpointer
> view. We can use pg_stat_bgwriter instead. The SQL is as follows: SELECT
> checkpoints_timed AS num_timed, -- Checkpoints triggered by timeout
> checkpoints_req AS num_requested,
> ZjQcmQRYFpfptBannerStart
> This Message Is From an Untrusted Sender
> You have not previously corresponded with this sender.
>
> ZjQcmQRYFpfptBannerEnd
> I found that PostgreSQL 15.3 doesn't support the pg_stat_checkpointer
> view. We can use pg_stat_bgwriter instead. The SQL is as follows:
>
> SELECT
> checkpoints_timed AS num_timed, -- Checkpoints triggered by timeout
> checkpoints_req AS num_requested, -- Checkpoints triggered by requests (like when WAL space is tight)
> round(
> (checkpoints_req::numeric / NULLIF(checkpoints_timed + checkpoints_req, 0)) * 100,
> 2
> ) AS requested_pct -- % of checkpoints that were request-triggered
> FROM pg_stat_bgwriter;
>
>
>
> *From:* Sam Stearns <[email protected]>
> *Date:* 2025-11-11 23:24
> *To:* Fabrice Chapuis <[email protected]>; Laurenz Albe
> <[email protected]>; Ron Johnson <[email protected]>
> *CC:* Pgsql-admin <[email protected]>; Henry Ashu
> <[email protected]>
> *Subject:* Re: Postgres Parameters
> Awesome stuff. Thank you, everyone!
>
> Sam
>
>
> On Tue, Nov 11, 2025 at 3:19 AM Fabrice Chapuis <[email protected]>
> wrote:
>
>> Hi, You could also use this query, if the ratio is low, that means there
>> is no pressure on wal size and you can keep the max_wal_size value as it
>> is. SELECT num_timed, num_requested, round((num_requested: : numeric /
>> NULLIF(num_timed + num_requested,
>> ZjQcmQRYFpfptBannerStart
>> This Message Is From an Untrusted Sender
>> You have not previously corresponded with this sender.
>>
>> ZjQcmQRYFpfptBannerEnd
>> Hi,
>>
>> You could also use this query, if the ratio is low, that means there is
>> no pressure on wal size and you can keep the max_wal_size value as it is.
>>
>> SELECT
>> num_timed,
>> num_requested,
>> round((num_requested::numeric / NULLIF(num_timed + num_requested, 0)) *
>> 100, 2)
>> AS requested_pct
>> FROM pg_stat_checkpointer;
>> +-----------+---------------+---------------+
>> | num_timed | num_requested | requested_pct |
>> +-----------+---------------+---------------+
>> | 3502 | 146 | 4.00 |
>> +-----------+---------------+---------------+
>> (1 row)
>>
>> Regards,
>>
>> Fabrice
>>
>>
>> On Tue, Nov 11, 2025 at 12:28 AM Sam Stearns <[email protected]> wrote:
>>
>>> Howdy,
>>>
>>> Could someone advise on how to determine the correct settings for the
>>> following, please?:
>>>
>>>
>>> - checkpoint_timeout
>>> - max_wal_size
>>>
>>>
>>> Thank you,
>>>
>>> Sam
>>>
>>> --
>>>
>>> Samuel Stearns
>>> Team Lead - Database
>>> c: 971 762 6879 | o: 971 762 6879 | DAT.com
>>>
>>>
>>> <https://www.dat.com/?utm_medium=email&utm_source=DAT_email_signature_link;
>>>
>>>
>
> --
>
> Samuel Stearns
> Team Lead - Database
> c: 971 762 6879 | o: 971 762 6879 | DAT.com
>
> <https://www.dat.com/?utm_medium=email&utm_source=DAT_email_signature_link;
>
>
--
Samuel Stearns
Team Lead - Database
c: 971 762 6879 | o: 971 762 6879 | DAT.com
<https://www.dat.com/?utm_medium=email&utm_source=DAT_email_signature_link;
view thread (7+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Re: Postgres Parameters
In-Reply-To: <CAN6TVjndnx18mPT2aU4c+rG1X=vLb8eZF5WAF4dXGOTHrgB1Gg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox