Re: pg_stat_statements oddity with track = all

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Sergei Kornilov <sk(at)zsrv(dot)org>
Cc: legrand legrand <legrand_legrand(at)hotmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_stat_statements oddity with track = all
Date: 2020-12-04 08:15:48
Message-ID: 20201204081548.GA76762@nol
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 03, 2020 at 04:53:59PM +0800, Julien Rouhaud wrote:
> On Thu, Dec 03, 2020 at 11:40:22AM +0300, Sergei Kornilov wrote:
> > Hello
> >
> > > To get an increase in the number of records that means that the same
> > > statement
> > > would appear at top level AND nested level. This seems a corner case with
> > > very low
> > > (neglectible) occurence rate.
> >
> > +1
> > I think splitting fields into plans_toplevel / plans_nested will be less convenient. And more code with higher chance of copypaste errors
>
> As I mentioned in a previous message, I really have no idea if that would be a
> corner case or not. For instance with native partitioning, the odds to have
> many different query executed both at top level and as a nested statement may
> be quite higher.

The consensus seems to be adding a new boolean toplevel flag in the entry key,
so PFA a patch implementing that. Note that the key now has padding, so
memset() calls are required.

Attachment Content-Type Size
v1-0001-Add-a-bool-toplevel-column-to-pg_stat_statements.patch text/plain 12.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2020-12-04 08:16:40 Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit
Previous Message tsunakawa.takay@fujitsu.com 2020-12-04 07:49:22 RE: In-placre persistance change of a relation