Re: [HACKERS] Planning counters in pg_stat_statements

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Subject: Re: [HACKERS] Planning counters in pg_stat_statements
Date: 2018-01-11 11:00:12
Message-ID: CAEepm=2vORBhWQZ1DJmKXmCVi+15Tgrv+9brHLanWU7XE_FWxQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 11, 2018 at 7:36 PM, Haribabu Kommi
<kommi(dot)haribabu(at)gmail(dot)com> wrote:
> -DATA = pg_stat_statements--1.4.sql pg_stat_statements--1.4--1.5.sql \
> +DATA = pg_stat_statements--1.5.sql pg_stat_statements--1.4--1.5.sql \
>
> The current version of the pg_stat_statements is already 1.5, this patch
> should increase it to 1.6.

Uglhl, yeah. Fixed. So I've removed the 1.4 script, added a 1.6
script and provided the 1.5->1.6 upgrade script. I've tested
installing 1.6 directly, as well as installing 1.5 from unpatched
master and then upgrading to 1.6 with ALTER EXTENSION
pg_stat_statements UPDATE TO "1.6".

> +/* contrib/pg_stat_statements/pg_stat_statements--1.5.sql */
>
> Add the contents of the pg_stat_statements--1.4--1.5.sql file here,
> otherwise
> when the user installs this as a new extension, he will loose those changes.

That GRANT command is now in pg_stat_statements--1.6.sql.

> + OUT plans int8,
>
> Addition of this column is good to find out how many time the plan is
> generated
> for the same query. But I am thinking "plans" column name may confuse?

What else would you call that? It's the number of plans that have
been created. It sits nicely beside "calls" don't you think? I could
change it to "plan_count" but that's longer and not like "calls".

> + OUT plan_time float8,
>
> I am fine with the current name also, just checking how about
> "planning_time"
> similar like EXPLAIN?

Ok, changed to planning_time.

> + <row>
> + <entry><structfield>plan_time</structfield></entry>
> + <entry><type>double precision</type></entry>
> + <entry></entry>
> + <entry>Total time spent planning, in milliseconds</entry>
> + </row>
>
> How about "Total time spent in the statement planning"?

Ok, changed to:

+ <entry>Total time spent planning the statement, in milliseconds</entry>

> And also it needs an update for the total_time column as
> "Total time spent in the statement execution".

Ok, changed to:

- <entry>Total time spent in the statement, in milliseconds</entry>
+ <entry>Total time spent executing the statement, in milliseconds</entry>

... and likewise for the min, max, avg, stddev columns.

> +
> /* ----------------
> * PlannedStmt node
> *
>
> Extra change.

Fixed.

Thanks!

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
pg-stat-statements-planning-v2.patch application/octet-stream 23.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Korotkov 2018-01-11 11:00:45 Re: CUBE seems a bit confused about ORDER BY
Previous Message David Rowley 2018-01-11 10:40:04 Re: [Sender Address Forgery]Re: [HACKERS] path toward faster partition pruning