Re: [PATCH] Add last_executed timestamp to pg_stat_statements

From: Christoph Berg <myon(at)debian(dot)org>
To: Pavlo Golub <pavlo(dot)golub(at)cybertec(dot)at>
Cc: Sami Imseih <samimseih(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Add last_executed timestamp to pg_stat_statements
Date: 2026-02-06 12:21:09
Message-ID: aYXcteoB-JSqP4m9@msg.df7cb.de
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Re: Pavlo Golub
> If we do
>
> WHERE last_execution_start + max_exec_time * INTERVAL '1 ms' > NOW() -
> polling_interval

Is this extra complexity worth one saved GetCurrentTimestamp()?

src/backend/access/transam/xact.c is calling GetCurrentTimestamp a
lot already, so I don't really buy the argument it should be avoided
at all cost in pg_stat_statements. Just storing the statement end time
would make this use case much nicer.

Christoph

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Matheus Alcantara 2026-02-06 12:25:04 Re: Show expression of virtual columns in error messages
Previous Message Pavlo Golub 2026-02-06 11:19:26 Re[2]: [PATCH] Add last_executed timestamp to pg_stat_statements