Re: [PATCH v5] pg_stat_statements: Add last_execution_start column - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [PATCH v5] pg_stat_statements: Add last_execution_start column
Date
Msg-id sznxsch5fqidpp6636eugbpk4ady5kmffhyrvb2yy6ve6cgw47@p6z5z6cdjtte
Whole thread
In response to [PATCH v5] pg_stat_statements: Add last_execution_start column  ("Pavlo Golub" <pavlo.golub@cybertec.at>)
List pgsql-hackers
Hi,

On 2026-06-10 17:36:24 +0000, Pavlo Golub wrote:
> @@ -1490,6 +1509,10 @@ pgss_store(const char *query, int64 queryId,
>          else if (planOrigin == PLAN_STMT_CACHE_CUSTOM)
>              entry->counters.custom_plan_calls++;
>  
> +        /* Record the start time of this execution, if provided */
> +        if (exec_start != 0)
> +            entry->last_execution_start = exec_start;
> +
>          SpinLockRelease(&entry->mutex);
>      }

FWIW, I remain opposed to adding *any* additional thing under the spinlock. We
first need to fix the design of pgss, then we can start discussing expanding
it even further.

I've seen way too many instances being brought to their knee because of pgss
contention.  We shouldn't make it even worse.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Sehrope Sarkuni
Date:
Subject: Assorted Win32 error handling fixes (CreateThread, pgwin32_select, pg_usleep)
Next
From: Cary Huang
Date:
Subject: Re: [PATCH] psql: add \dcs to list all constraints