Re: [FEATURE PATCH] pg_stat_statements with plans (v02)

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Julian Markwort <julian(dot)markwort(at)uni-muenster(dot)de>
Cc: legrand legrand <legrand_legrand(at)hotmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Arthur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, David Steele <david(at)pgmasters(dot)net>, marius(dot)timmer(at)uni-muenster(dot)de, arne(dot)scheffer(at)uni-muenster(dot)de
Subject: Re: [FEATURE PATCH] pg_stat_statements with plans (v02)
Date: 2018-08-20 00:45:02
Message-ID: CAEepm=1uzE8tK4cv_0fnQTK_DnDgG7267LqmQnHL979ycKrRFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Apr 7, 2018 at 1:03 AM, Julian Markwort
<julian(dot)markwort(at)uni-muenster(dot)de> wrote:
> I've created a draft patch that provides access to plans in a view called pg_stat_statements_plans.
> There is no column that indicates whether the plan is "good" or "bad", because that is evident from the execution time of both plans and because that would require some kind of plan_type for all plans that might be stored in future versions.
>
> Please take it for a spin and tell me, whether the layout and handling of the view make sense to you.

I realise this is probably WIP, but for what it's worth here's some
feedback from my patch testing robot:

+ +INFINITY,

That ^ is from C99 math.h, and so we don't currently expect compilers
to have it (until such time as we decide to pull the trigger and
switch to C99, as discussed in a nearby thread):

contrib/pg_stat_statements/pg_stat_statements.c(482): error C2065:
'INFINITY' : undeclared identifier
[C:\projects\postgresql\pg_stat_statements.vcxproj]
5826

Maybe get_float8_infinity()?

+ for(int j = 0; j < numPlans; j++)

Can't declare a new variable here in C89.

+ pgssPlan *planArray[numPlans];

Can't use variable length arrays in C89.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-08-20 00:50:01 Re: [PATCH] Add regress test for pg_read_all_stats role
Previous Message Michael Paquier 2018-08-19 23:09:52 Re: Temporary tables prevent autovacuum, leading to XID wraparound