Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry
От | Andres Freund |
---|---|
Тема | Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry |
Дата | |
Msg-id | 20230216212121.uvav7xgdh2ysqjy5@awork3.anarazel.de обсуждение исходный текст |
Ответ на | Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry ("Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>) |
Ответы |
Re: Reconcile stats in find_tabstat_entry() and get rid of PgStat_BackendFunctionEntry
|
Список | pgsql-hackers |
Hi, On 2023-02-15 09:21:48 +0100, Drouvot, Bertrand wrote: > diff --git a/src/backend/utils/activity/pgstat_relation.c b/src/backend/utils/activity/pgstat_relation.c > index f793ac1516..b26e2a5a7a 100644 > --- a/src/backend/utils/activity/pgstat_relation.c > +++ b/src/backend/utils/activity/pgstat_relation.c > @@ -471,20 +471,46 @@ pgstat_fetch_stat_tabentry_ext(bool shared, Oid reloid) > * Find any existing PgStat_TableStatus entry for rel_id in the current > * database. If not found, try finding from shared tables. > * > + * If an entry is found, copy it and increment the copy's counters with their > + * subtransactions counterparts. Then return the copy. There is no need for the > + * caller to pfree the copy as the MemoryContext will be reset soon after. > + * The "There is no need" bit seems a bit off. Yes, that's true for the current callers, but who says that it has to stay that way? Otherwise this looks ready, on a casual scan. Greetings, Andres Freund
В списке pgsql-hackers по дате отправления: