pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Julien Rouhaud <rjuju123@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: expose parallel leader in CSV and log_line_prefix
Date: Fri, 10 Jul 2020 11:55:25 -0500
Message-ID: <20200710165524.GL26220@telsasoft.com> (raw)
In-Reply-To: <20200710164529.GA23646@alvherre.pgsql>
References: <20200318212511.GN26184@telsasoft.com>
	<20200710164529.GA23646@alvherre.pgsql>

On Fri, Jul 10, 2020 at 12:45:29PM -0400, Alvaro Herrera wrote:
> On 2020-Mar-18, Justin Pryzby wrote:
> 
> > On Sun, Mar 15, 2020 at 12:49:33PM +0100, Julien Rouhaud wrote:
> 
> > template1=# SET log_temp_files=0; explain analyze SELECT a,COUNT(1) FROM t a JOIN t b USING(a) GROUP BY 1;
> > 2020-03-15 21:20:47.288 CDT [5537        5537]LOG:  statement: SET log_temp_files=0;
> > SET
> > 2020-03-15 21:20:47.289 CDT [5537        5537]LOG:  statement: explain analyze SELECT a,COUNT(1) FROM t a JOIN t b USING(a) GROUP BY 1;
> > 2020-03-15 21:20:51.253 CDT [5627        5537]LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp5627.0", size 6094848
> > 2020-03-15 21:20:51.253 CDT [5627        5537]STATEMENT:  explain analyze SELECT a,COUNT(1) FROM t a JOIN t b USING(a) GROUP BY 1;
> > 2020-03-15 21:20:51.254 CDT [5626        5537]LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp5626.0", size 6103040
> > 2020-03-15 21:20:51.254 CDT [5626        5537]STATEMENT:  explain analyze SELECT a,COUNT(1) FROM t a JOIN t b USING(a) GROUP BY 1;
> > 2020-03-15 21:20:51.263 CDT [5537        5537]LOG:  temporary file: path "base/pgsql_tmp/pgsql_tmp5537.1.sharedfileset/o15of16.p0.0", size 557056
> 
> I think it's overly verbose; all non-parallel backends are going to get
> their own PID twice, and I'm not sure this is going to be great to
> parse.  I think it would be more sensible that if the process does not
> have a parent (leader), %P expands to empty.

That's what's done.

+             <entry>Process ID of the parallel group leader if this process was
+             at some point involved in parallel query, otherwise null.  For a
+             parallel group leader itself, this field is set to its own process
+             ID.</entry>

2020-07-10 11:53:32.304 CDT [16699 ]LOG:  statement: SELECT 1;
2020-07-10 11:53:32.304 CDT,"pryzbyj","postgres",16699,"[local]",5f089d0b.413b,1,"idle",2020-07-10 11:53:31 CDT,3/4,0,LOG,00000,"statement: SELECT 1;",,,,,,,,,"psql","client backend",

-- 
Justin





view thread (37+ messages)  latest in thread

Message-ID: <20200710165524.GL26220@telsasoft.com>
Permalink:  ../20200710165524.GL26220@telsasoft.com/
Also on:    postgresql.org/message-id/20200710165524.GL26220@telsasoft.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: pryzby@telsasoft.com, alvherre@2ndquadrant.com, rjuju123@gmail.com
  Subject: Re: expose parallel leader in CSV and log_line_prefix
  In-Reply-To: <20200710165524.GL26220@telsasoft.com>

* 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