Re: Normalization of utility queries in pg_stat_statements

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Normalization of utility queries in pg_stat_statements
Date: 2023-02-20 02:32:23
Message-ID: Y/Lbt12YUHSU2fYl@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-02-20 02:34:59 Re: Normalization of utility queries in pg_stat_statements
Previous Message Hayato Kuroda (Fujitsu) 2023-02-20 02:27:26 RE: Time delayed LR (WAS Re: logical replication restrictions)