Re: Patch to address creation of PgStat* contexts with null parent context

From: Andres Freund <andres(at)anarazel(dot)de>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: bdrouvot(at)amazon(dot)com, reid(dot)thompson(at)crunchydata(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Patch to address creation of PgStat* contexts with null parent context
Date: 2022-09-05 22:47:37
Message-ID: 20220905224737.k7m7snxydkcf7pdk@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-09-05 17:32:20 +0900, Kyotaro Horiguchi wrote:
> The rationale of creating them at pgstat_attach_shmem is that anyway once
> pgstat_attach_shmem is called, the process fainally creates the contexts at
> the end of the process, and (I think) it's simpler that we don't do if()
> check at every pgstat_get_entry_ref() call.

But that's not true, as pointed out here:
https://postgr.es/m/20220808192020.nc556tlgcp66fdgw%40awork3.anarazel.de

Nor does it make sense to reserve memory for the entire lifetime of a process
just because we might need it for a split second at the end.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-09-05 23:09:49 Re: Reducing the chunk header sizes on all memory context types
Previous Message Tom Lane 2022-09-05 22:27:46 Modernizing our GUC infrastructure