Re: [PATCH] Add features to pg_stat_statements

From: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
To: Yuki Seino <seinoyu(at)oss(dot)nttdata(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: yuta katsuragi <btkatsuragiyu(at)oss(dot)nttdata(dot)com>
Subject: Re: [PATCH] Add features to pg_stat_statements
Date: 2020-10-21 16:31:11
Message-ID: 369018a4-746c-6914-4983-1b79aa9fdd37@oss.nttdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020/10/12 21:18, Yuki Seino wrote:
> The following review has been posted through the commitfest application:
> make installcheck-world: tested, passed
> Implements feature: tested, passed
> Spec compliant: tested, passed
> Documentation: tested, passed
>
> The patch applies cleanly and looks fine to me. It's a small detail, However wouldn't it be better if the following changes were made.
>
> 1.There are unnecessary difference lines 707 and 863 in "pg_stat_statements.c".
> 2.There is no comment on "slock_t mutex" in "struct pgssCtlCounter" in "pg_stat_statements.c".
> 3."update_ctl" and "reset_ctl" are generic and illegible name.You might want to rename it something like "pgss_ctl_update".
> 4.To improve the readability of the source, why not change the function declaration option in "pg_stat_statements_ctl" from
> "AS 'MODULE_PATHNAME'" to "AS 'MODULE_PATHNAME', 'pg_stat_statements_ctl'"? in "pg_stat_statements--1.8--1.9.sql".
>
> The new status of this patch is: Waiting on Author

Here are other comments from me.

-DATA = pg_stat_statements--1.4.sql \
+DATA = pg_stat_statements--1.4.sql pg_stat_statements--1.8--1.9.sql\

One space character needs to be added just before the character "\".

+--- Define pg_stat_statements_ctl

ISTM that this is not good name.
What about pg_stat_statements_info, _stats, _activity or something?

+ OUT dealloc integer,

The type of "dealloc" should be bigint, instead?

+ OUT last_dealloc TIMESTAMP WITH TIME ZONE

Is this information really useful?
If there is no valid use case for this, I'd like to drop it.
Thought?

+LANGUAGE C STRICT VOLATILE PARALLEL SAFE;

There are two space characters just after "LANGUAGE".
One space character should be removed from there.

+CREATE VIEW pg_stat_statements_ctl AS
+ SELECT * FROM pg_stat_statements_ctl();

If we rename the function, this view name also should be changed.

+GRANT SELECT ON pg_stat_statements TO PUBLIC;

"pg_stat_statements" should be "pg_stat_statement_xxx"?

Regards,

--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-10-21 17:02:37 Re: CREATE TABLE .. PARTITION OF fails to preserve tgenabled for inherited row triggers
Previous Message Mark Dilger 2020-10-21 16:14:53 Re: refactoring basebackup.c