refreshing query id for pg_stat_statements based on comment in sql - Mailing list pgsql-hackers

From Zhihong Yu
Subject refreshing query id for pg_stat_statements based on comment in sql
Date
Msg-id CALNJ-vSijzziYNRD3HTY72Uh+sHSYr5DbfqBKzSvysSvqs9UtQ@mail.gmail.com
Whole thread Raw
Responses Re: refreshing query id for pg_stat_statements based on comment in sql
Re: refreshing query id for pg_stat_statements based on comment in sql
List pgsql-hackers
Hi,
Currently the query id for pg_stat_statements gets calculated based on the parse nodes specifics. 
This means that the user cannot add a comment to a SQL query to test something. (though some other RDBMS allows this practice).

Consider this use case: for query q, admin looks at stats and performs some optimization (without changing the query). Admin adds / modifies the comment for q - now the query becomes q'. If query id doesn't change, there still would be one row in pg_stat_statements which makes it difficult to gauge the effectiveness of the tuning.

I want to get opinion from the community whether adding / changing comment in SQL query should result in new query id for pg_stat_statements.

Cheers

pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: [PATCH] minor reloption regression tests improvement
Next
From: Nikolay Shaplov
Date:
Subject: Re: [PATCH] minor reloption regression tests improvement