Re: Normalization of utility queries in pg_stat_statements - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Normalization of utility queries in pg_stat_statements
Date
Msg-id Y/Lbt12YUHSU2fYl@paquier.xyz
Whole thread Raw
In response to Re: Normalization of utility queries in pg_stat_statements  ("Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>)
Responses Re: Normalization of utility queries in pg_stat_statements
List pgsql-hackers
On Fri, Feb 17, 2023 at 09:36:27AM +0100, Drouvot, Bertrand wrote:
> On 2/17/23 3:35 AM, Michael Paquier wrote:
>> 0001 looks quite committable at this stage, and that's independent on
>> the rest.  At the end this patch creates four new test files that are
>> extended in the next patches: utility, planning, track and cleanup.
>
> Thanks! LGTM.

Thanks.  I have applied the set of regression tests in 0001 and 0002.
Note that I have changed the order of the attributes when querying
pg_stat_statements, to make easier to follow the diffs generated by
the normalization.  The unaligned mode would be another option, but
it makes not much sense as long as there are no more than two fields
with variable lengths.  Some extra notes about that:
- Should the test for the validation WAL generation metrics be moved
out?  I am not sure that it makes much sense to separate it as it has
a short purpose.
- Same issue with user activity, which creates a few roles and makes
sure that their activity is tracked?  We don't look at the userid in
this case, which does not make much sense to me.
- Same issue with locking clauses, worth a file of their own?

The main file is still named pg_stat_statements.sql, perhaps it should
be renamed to something more generic, like general.sql?  Or perhaps we
could just split the main file with a select.sql (with locking
clauses) and a dml.sql?

>> I am wondering if others have an opinion to share about that, but,
>> yes, 0004 seems enough to begin with.  We could always study more
>> normalization areas in future releases, taking it slowly.
>
> Agree.

These last ones are staying around for a few more weeks, until the
middle of the next CF, I guess.  After all this is done, the final
changes are very short, showing the effects of the normalization, as
of:
 6 files changed, 45 insertions(+), 35 deletions(-)
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Time delayed LR (WAS Re: logical replication restrictions)
Next
From: Michael Paquier
Date:
Subject: Re: Normalization of utility queries in pg_stat_statements