Re: pgstat: Flush some statistics within running transactions, take 2

From: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Lukas Fittl <lukas(at)fittl(dot)com>
Subject: Re: pgstat: Flush some statistics within running transactions, take 2
Date: 2026-08-31 20:17:28
Message-ID: CAN12+YKm93AOjAMqzTZquWrD-CB5FroJAECGxqQpL_yfnDkHgA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here is v9- with:

1/ to also pgStatFlushInProgress when we're-queueing

pgstat_prep_pending_from_entry_ref(PgStat_EntryRef *entry_ref)
{
...
....
else if (pgStatFlushInProgress && entry_ref->flushed_this_pass)
...
...
}

2/ Added an `Assert(!pgStatFlushInProgress);` inside pgstat_report_stat().

This should never be called while there is a flush in progress.

--
Sami

Attachment Content-Type Size
v9-0002-pgstat-Allow-pg_stat_force_next_flush-to-work-in-.patch application/octet-stream 97.6 KB
v9-0001-pgstat-Split-table-stat-counters-into-transaction.patch application/octet-stream 25.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kiran Kaki 2026-08-31 20:21:12 Re: REPACK (CONCURRENTLY) fails with wrong error for materialized views
Previous Message Alberto Piai 2026-08-31 18:41:33 Re: Adding a stored generated column without long-lived locks