Re: [PATCH] Query Jumbling for CALL and SET utility statements

Drouvot, Bertrand <bdrouvot@amazon.com>

From: "Drouvot, Bertrand" <bdrouvot@amazon.com>
To: "Imseih (AWS), Sami" <simseih@amazon.com>, "Schneider (AWS), Jeremy" <schnjere@amazon.com>, Andres Freund <andres@anarazel.de>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Pavel Stehule <pavel.stehule@gmail.com>, Nikolay Samokhvalov <samokhvalov@gmail.com>
Date: 2022-09-02T09:06:50Z
Lists: pgsql-hackers

Attachments

Hi,

On 9/1/22 5:13 PM, Imseih (AWS), Sami wrote:
>
> > Please find attached v2 as an attempt to do so.
>
> +1 to the idea.
>
Thanks for looking at it!

> I think it will be better to evaluate jstate instead of
>
> JUMBLE_UTILITY, such as:
>
> if (query->utilityStmt && !jstate)
>
> instead of
>
> if (query->utilityStmt && !JUMBLE_UTILITY(query->utilityStmt))
>
> This will allow for support of potentially other utility statements
>
> In the future without having to teach pg_stat_statements about them.
>
> If a jstate is set for the utility statements, pgss will do the right 
> thing.
>
Fair point, thanks!

v3 including this change is attached.

Thanks,

-- 

Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services:https://aws.amazon.com

Commits

  1. Show values of SET statements as constants in pg_stat_statements

  2. Teach contrib/pg_stat_statements to handle multi-statement commands better.