Re: [FEATURE PATCH] pg_stat_statements with plans (v02) - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [FEATURE PATCH] pg_stat_statements with plans (v02)
Date
Msg-id CAEepm=1uzE8tK4cv_0fnQTK_DnDgG7267LqmQnHL979ycKrRFA@mail.gmail.com
Whole thread Raw
In response to Re: [FEATURE PATCH] pg_stat_statements with plans (v02)  (Julian Markwort <julian.markwort@uni-muenster.de>)
Responses Re: [FEATURE PATCH] pg_stat_statements with plans (v02)
List pgsql-hackers
On Sat, Apr 7, 2018 at 1:03 AM, Julian Markwort
<julian.markwort@uni-muenster.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
timeof 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


pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Temporary tables prevent autovacuum, leading to XID wraparound
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH] Add regress test for pg_read_all_stats role