Re: [HACKERS] Planning counters in pg_stat_statements - Mailing list pgsql-hackers

From Haribabu Kommi
Subject Re: [HACKERS] Planning counters in pg_stat_statements
Date
Msg-id CAJrrPGfL95J2cxaJ3=bcVObfqzjQhwdLL1Cur4KXMWrmO_4NAw@mail.gmail.com
Whole thread Raw
In response to [HACKERS] Planning counters in pg_stat_statements  (Thomas Munro <thomas.munro@enterprisedb.com>)
Responses Re: [HACKERS] Planning counters in pg_stat_statements
List pgsql-hackers

On Tue, Nov 7, 2017 at 4:10 PM, Thomas Munro <thomas.munro@enterprisedb.com> wrote:
Hi hackers,

I have often wanted $SUBJECT and was happy to find that Fujii-san had
posted a patch five years ago[1].  The reception then seemed positive.
So here is a refurbished and (hopefully) improved version of his patch
with a new column for the replan count.  Thoughts?

Thanks for the patch.

-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.

+/* 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.

+    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?

+    OUT plan_time float8,

I am fine with the current name also, just checking how about "planning_time"
similar like EXPLAIN?


+     <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"?

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

+
 /* ----------------
  * PlannedStmt node
  *

Extra change.


Regards,
Hari Babu
Fujitsu Australia

pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: numeric regression test passes, but why?
Next
From: Christian Ullrich
Date:
Subject: RE: pl/perl extension fails on Windows