Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtw9d-0004lO-7X for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2020 16:45:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jtw9b-0002kD-VY for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2020 16:45:39 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtw9b-0002k6-KT for pgsql-hackers@lists.postgresql.org; Fri, 10 Jul 2020 16:45:39 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jtw9U-0001MH-OW for pgsql-hackers@postgresql.org; Fri, 10 Jul 2020 16:45:38 +0000 Received: by mail-qk1-x743.google.com with SMTP id l6so5883791qkc.6 for ; Fri, 10 Jul 2020 09:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=U4Bq8cChe63HqnPUjkr8yLCFYqicL7Fz6W2wuvBoX3M=; b=msUcyQuD+ZwTkDBeKzq+XcFu70KqsYvAmXWedqZ8HWr/Mob5bh1x+EOg9QcSbYjtV5 0uSI0lrtJLHrlvd3UdPWXA6Nkwipgd4WQlVJ80QxlnNHsUr6mryehr7Ur7XdOuMzrso0 w4l592amRzVXEOYjD8MyBTKQPjKOwrKsvkLPuZMXtEdahJ89vovnOb3Q5ujHP+nrr1y0 RSUQEbs1wziM204xKPagir3anweAW/5T9DGKO1c/Pz0Y+Nb6WQM8CtF8eOIUHRhoN2d/ auO1Vj4X5P8qEnaHfgyGIk6yXVR1JKvBnlMoAwEZIlx+I2qgNBZtlQVq85j6Mv9++oW7 Tt0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=U4Bq8cChe63HqnPUjkr8yLCFYqicL7Fz6W2wuvBoX3M=; b=kUP7cMdwA13p7veVlan1s8ipKhGVc2bu1xfo6cVdakuVPLuHgeNc77XrVXIrvKtQpw tk+6265++vNCHR1gHJeSQL3o/oZoxP1bP0qa90FhwvuHtEIHw10gt6ESO+lIkk2Q7Ivv FXtQhg56/0mzQdE11+D1FB6Ya6GGGXd024x3mebD/MdT3rKxU4sOz0PjlmT7GP2jdEZv PGP3sHHeA6JnBCEPmWCg0fb3mFzf5BiBpttNCp8b9z5u2wLH8xE9ZzCO2jMiG7I4ES+W ededDlF1KNTD+jOo7/cN6M2tddYSlsHmYwLD63eZK0KAmYmblPbMozI9377KreTQ+H1T 6T5Q== X-Gm-Message-State: AOAM5329F0ezk2kVdCYS3BD30xVJ/MAMYVwv0mZRR+xxh7Yp3bg0N7mO iZMBlIuG+uyL8bbCk7BsutRf+w== X-Google-Smtp-Source: ABdhPJw8Gg9vqDYAKT0aYUZdXa5ZwJFcfGZ4gHKbd2AoGJfyY8Yj4ckp8Ie2ewC8NqHFbBAqzQ+9Mw== X-Received: by 2002:a37:a8ca:: with SMTP id r193mr65854515qke.118.1594399531356; Fri, 10 Jul 2020 09:45:31 -0700 (PDT) Received: from perhan.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id o187sm7698418qkd.112.2020.07.10.09.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jul 2020 09:45:30 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 26C7D2A38D3; Fri, 10 Jul 2020 12:45:29 -0400 (-04) Date: Fri, 10 Jul 2020 12:45:29 -0400 From: Alvaro Herrera To: Justin Pryzby Cc: Julien Rouhaud , pgsql-hackers@postgresql.org Subject: Re: expose parallel leader in CSV and log_line_prefix Message-ID: <20200710164529.GA23646@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200318212511.GN26184@telsasoft.com> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services