On Mon, Feb 16, 2026 at 04:06:50PM -0600, Sami Imseih wrote:
>> I simplified the implementation to use GetCurrentTimestamp() directly
>> instead of calculating the timestamp from
>
> I don't think it will be acceptable to add GetCurrentTimestamp() at the end of
> every execution. We take extra measures to avoid such overhead in core, and
> I don't think we should impose this on pg_stat_statements users as well.
The posted v4 adds a GetCurrentTimestamp(), synonym of gettimeofday(),
for each call of pgss_store(). I suspect that this choice most likely
makes it a no-go on performance ground, and there have been complaints
about PGSS becoming noticeably slower with more fields added for the
last couple of releases. A timestamp call at reset or allocation is a
different matter, as it is capped naturally by a workload and the
number of entries configured. A timestamp call done each time an
entry is updated will make this code show higher in profiles.
--
Michael