Re: Flush some statistics within running transactions

From: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Subject: Re: Flush some statistics within running transactions
Date: 2026-02-20 15:55:27
Message-ID: aZiD74ZVehxfgqxM@ip-10-97-1-34.eu-west-3.compute.internal
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Feb 19, 2026 at 04:08:59PM -0600, Sami Imseih wrote:
> > > Not a fan of the hardcoded sleeps in the tests, either.
> >
> > Yeah, after our off-list discussion yesterday, I tried to implement the same
> > trick that f1e251be80a has done with injection points (nice trick by the way!),

PFA, a tiny ("include") rebase due to 9842e8aca09 (the v9 patch series was applying
but not compiling).

> I took a look at this today out of interest,

Thanks!

> so, instead of calling IS_INJECTION_POINT_ATTACHED macro which is

I think that not calling IS_INJECTION_POINT_ATTACHED() but only relying on
"ifdef USE_INJECTION_POINTS" would set the tiny timeout value to the entire test
suit.

I'm waiting for Michael's feedback about the current design ([1]) to see if it's
still worth spending time improving the tests.

[1]: https://postgr.es/m/aZbDYMrOkeCyIubO%40ip-10-97-1-34.eu-west-3.compute.internal

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v10-0001-Add-pgstat_report_anytime_stat-for-periodic-stat.patch text/x-diff 42.9 KB
v10-0002-Add-anytime-flush-tests-for-custom-stats.patch text/x-diff 9.0 KB
v10-0003-Add-GUC-to-specify-non-transactional-statistics-.patch text/x-diff 9.8 KB
v10-0004-Remove-useless-calls-to-flush-some-stats.patch text/x-diff 7.7 KB
v10-0005-Change-RELATION-and-DATABASE-stats-to-anytime-fl.patch text/x-diff 34.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2026-02-20 16:02:49 Re: Adding locks statistics
Previous Message KAZAR Ayoub 2026-02-20 15:53:14 Re: Unexpectedly exposed COPY option: convert_selectively