Re: [PATCH v4] pg_stat_statements: Add last_execution_start column

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Pavlo Golub <pavlo(dot)golub(at)cybertec(dot)at>, Sami Imseih <samimseih(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH v4] pg_stat_statements: Add last_execution_start column
Date: 2026-06-09 13:16:32
Message-ID: 65e8c801-7b00-4974-bae3-ac192573f24a@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 13.05.26 16:38, Pavlo Golub wrote:
> Rebased on current master (a3e6beba60e).
>
> The only conflict was with commit 66366217822 (pg_stat_statements: Set
> PlannedStmt to NULL after nested utility execution), which introduced a
> local copy of pstmt->planOrigin and then nulled pstmt. The patch context
> line was updated to reference saved_planOrigin instead. No functional
> changes from v3.
>
> All pg_stat_statements regression tests pass (16/16).
>
> v4 patch attached.

Here is a summary of the feedback comments we discussed at pgconf.dev:

(Some of these might have applied to previous patch versions.)

technical:

- obvious concerns: getting current time is expensive (inside spinlock!)
- documenting intended use of the field is good, I would put that back
- issues with long-running queries, start time vs. end time -- ignores
analytics use cases
- argument total_time of pgss_store() is not documented, should be fixed
first -- also why is this double??
- issues with extended query protocol can be surprising
- comment says it can be executed under spinlock but then it's not
- only top-level statements? -- not acceptable IMO

code style:

- INT64CONST is useless
- when changing "two" to "three" in a comment, just delete the number

meta/process:

- good: patch versioned, commit message up to date
- I confused me that a new thread was started in the middle of the
discussion.
- As a theoretical committer, I would like to get Sami's and Christoph's
feedback on the latest patch version.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2026-06-09 13:31:01 Re: PG19 FK fast path: OOB write and missed FK checks during batched
Previous Message Ilia Evdokimov 2026-06-09 12:39:09 Re: Extended statistics improvement: multi-column MCV missing values