Re: [PATCH] Query Jumbling for CALL and SET utility statements - Mailing list pgsql-hackers

From Andres Freund
Subject Re: [PATCH] Query Jumbling for CALL and SET utility statements
Date
Msg-id 20220831190604.l2luuhj3xkau7dvk@awork3.anarazel.de
Whole thread Raw
In response to Re: [PATCH] Query Jumbling for CALL and SET utility statements  (Jeremy Schneider <schnjere@amazon.com>)
Responses Re: [PATCH] Query Jumbling for CALL and SET utility statements
List pgsql-hackers
Hi,

On 2022-08-31 11:00:05 -0700, Jeremy Schneider wrote:
> On 8/31/22 9:08 AM, Andres Freund wrote:
> > 
> > I suspect we should carve out things like CALL, PREPARE, EXECUTE from
> > track_utility - it's more or less an architectural accident that they're
> > utility statements.  It's a bit less clear that SET should be dealt with that
> > way.
> 
> Regarding SET, the compelling use case was around "application_name"
> whose purpose is to provide a label in pg_stat_activity and on log
> lines, which can be used to improve observability and connect queries to
> their source in application code.

I wasn't saying that SET shouldn't be jumbled, just that it seems more
reasonable to track it only when track_utility is enabled, rather than doing
so even when that's disabled. Which I do think makes sense for executing a
prepared statement and calling a procedure, since they're really only utility
statements by accident.


> Personally, at this point, I think pg_stat_statements is critical
> infrastructure for anyone running PostgreSQL at scale. The information
> it provides is indispensable. I don't think it's really defensible to
> tell people that if they want to scale, then they need to fly blind on
> any utility statements.

I wasn't suggesting doing so at all.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Tracking last scan time
Next
From: Andrew Dunstan
Date:
Subject: Re: SQL/JSON features for v15