pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Julien Rouhaud <rjuju123@gmail.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Fujii Masao <masao.fujii@oss.nttdata.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Nitin Jadhav <nitinjadhavpostgres@gmail.com>
Cc: Hannu Krosing <hannuk@google.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: torikoshia <torikoshia@oss.nttdata.com>
Cc: Atsushi Torikoshi <atorik@gmail.com>
Cc: Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Evgeny Efimkin <efimkin@yandex-team.ru>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Magnus Hagander <magnus@hagander.net>
Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
Date: Tue, 13 Jul 2021 14:10:23 +0800
Message-ID: <20210713061023.edgei4ooxexxsi5r@nol> (raw)
In-Reply-To: <8f5e63b8-e8ed-0f80-d8c4-68222624c200@enterprisedb.com>
References: <20210413021246.GD4231@momjian.us>
	<20210413173016.GA29955@alvherre.pgsql>
	<20210414183326.GA10946@momjian.us>
	<20210420162244.GD30205@momjian.us>
	<a878d5ea-64a7-485e-5d2f-177618ebc52d@oss.nttdata.com>
	<20210422092317.xnuvva2322dflxdm@nol>
	<8f5e63b8-e8ed-0f80-d8c4-68222624c200@enterprisedb.com>

On Mon, Jul 12, 2021 at 10:02:59PM +0200, Peter Eisentraut wrote:
> On 22.04.21 11:23, Julien Rouhaud wrote:
> >      The statistics gathered by the module are made available via a
> >      view named <structname>pg_stat_statements</structname>.  This view
> > -   contains one row for each distinct database ID, user ID and query
> > -   ID (up to the maximum number of distinct statements that the module
> > +   contains one row for each distinct database ID, user ID, query ID and
> > +   toplevel (up to the maximum number of distinct statements that the module
> >      can track).  The columns of the view are shown in
> >      <xref linkend="pgstatstatements-columns"/>.
> 
> I'm having trouble parsing this new sentence.  It now says essentially
> 
> "This view contains one row for each distinct database ID, each distinct
> user ID, each distinct query ID, and each distinct toplevel."

Isn't it each distinct permutation of all those fields?

> That last part doesn't make sense.

I'm not sure what you mean by that.  Maybe it's not really self explanatory
without referring to what toplevel is, which is a bool flag stating whether the
statement was exected as a top level statement or not.

So every distinct permutation of (dbid, userid, queryid) can indeed be stored
twice, if pg_stat_statements.track is set to all.  However in practice most
statements are not executed both as top level and nested statements.





view thread (222+ messages)  latest in thread

Message-ID: <20210713061023.edgei4ooxexxsi5r@nol>
Permalink:  ../20210713061023.edgei4ooxexxsi5r@nol/
Also on:    postgresql.org/message-id/20210713061023.edgei4ooxexxsi5r@nol

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: rjuju123@gmail.com, peter.eisentraut@enterprisedb.com, masao.fujii@oss.nttdata.com, bruce@momjian.us, alvherre@alvh.no-ip.org, tgl@sss.pgh.pa.us, nitinjadhavpostgres@gmail.com, hannuk@google.com, robertmhaas@gmail.com, pavel.stehule@gmail.com, michael@paquier.xyz, torikoshia@oss.nttdata.com, atorik@gmail.com, tatsuro.yamada.tf@nttcom.co.jp, tomas.vondra@2ndquadrant.com, efimkin@yandex-team.ru, magnus@hagander.net
  Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view?
  In-Reply-To: <20210713061023.edgei4ooxexxsi5r@nol>
  References: <20210413021246.GD4231@momjian.us> <20210413173016.GA29955@alvherre.pgsql> <20210414183326.GA10946@momjian.us> <20210420162244.GD30205@momjian.us> <a878d5ea-64a7-485e-5d2f-177618ebc52d@oss.nttdata.com> <20210422092317.xnuvva2322dflxdm@nol> <8f5e63b8-e8ed-0f80-d8c4-68222624c200@enterprisedb.com> <20210713061023.edgei4ooxexxsi5r@nol>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox