Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jBk8W-0002bM-Cd for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Mar 2020 19:01:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jBk8V-0002Os-4K for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Mar 2020 19:01:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jBk8U-0002Ol-OS for pgsql-hackers@lists.postgresql.org; Tue, 10 Mar 2020 19:01:50 +0000 Received: from mail-yw1-xc41.google.com ([2607:f8b0:4864:20::c41]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jBk8S-0002jm-0E for pgsql-hackers@postgresql.org; Tue, 10 Mar 2020 19:01:49 +0000 Received: by mail-yw1-xc41.google.com with SMTP id d206so14651777ywa.12 for ; Tue, 10 Mar 2020 12:01:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=2CP1fSqow2+4n9UGDO6ZVgDS8I+v++Y6w5z9hZCH/pY=; b=Kw79KB3KAxqyQQv8RkCcuptsr0UYp1RAhquIZXG0TD0bzDOUGw/VOno1uCd8QIo6m6 4KOOy1LsfMXh/84CL5Y3BR/XkyxTD+u/ec8NnaNeBY37eb1B7FkjO9GtRQf+N1JGNWq+ dmE/QAPwwrhd1UZekJPkVGjhaOcQWnljdx6WtdAiSPjJAO6CQd1hgzkJlC1F4T8OlP4S PDi3+xF2mkVBstOUq2oPJAKAbk+VmzplQxFdOFO/KK/THzNhb85sOf6Z8yGR1Sfj7yz6 NAN6ush8AnMpRi9iKNlp2OxuAfe3e/xJefxKWjdFyyykCcCpzZ57earbjrB9oJdoSUXi ge/Q== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=2CP1fSqow2+4n9UGDO6ZVgDS8I+v++Y6w5z9hZCH/pY=; b=mgNhl0HyGLrTUMAthoy6NE9gBA0Na/0cjLeirY4mB0S49R8RP44UqHVlMRZQo+zs1D nLh+iBy4a9xXowZ4dAVAXiEoUK70mlhh0OlukPTXw8rQ97VcamdIedSWHiuHZAGIF8pe pVXnphxlu60fk//ETTl912SXnKW50Lywfu1bI7KCdIPCVJWYfQ65a1yCnLDXT52+i07J Bj+PE6lt3wZQ9GMBB5XeRyjWClycIe6vZGqyEI7a6/q2Yqnrga8rYgGeDSjj/eiNk2oG F1xitX1QYnFR3Jt8pq0efbDMo8aipQCAfyxwdNSx6BwoMsW6xkUEBRfteb3YyYyxfX4b RjUg== X-Gm-Message-State: ANhLgQ33uIIqCCv/pg6hCNdnhKIkfWbHGWaeTzjYm8cZvfJQKQgbPrcv 9+IVo27wyxmzcesNMM4V9JcC6A== X-Google-Smtp-Source: ADFU+vvwgXiy9HETw2yhm/vurFBWQDS1ng4URBFgGKJlOmRIfkMKBP7NpZ3HGgXkoIiNI64Em6Q75Q== X-Received: by 2002:a0d:c8c2:: with SMTP id k185mr25160350ywd.8.1583866905182; Tue, 10 Mar 2020 12:01:45 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id g81sm5141787ywe.20.2020.03.10.12.01.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Mar 2020 12:01:44 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 1E7B0800964; Tue, 10 Mar 2020 14:01:43 -0500 (CDT) Date: Tue, 10 Mar 2020 14:01:43 -0500 From: Justin Pryzby To: Fujii Masao Cc: Julien Rouhaud , Peter Eisentraut , pgsql-hackers Subject: Re: backend type in log_line_prefix? Message-ID: <20200310190142.GB29065@telsasoft.com> References: <20200213091428.GA15600@nol> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, Feb 13, 2020 at 06:43:32PM +0900, Fujii Masao wrote: > If we do this, backend type should be also included in csvlog? +1, I've been missing that Note, this patch seems to correspond to: b025f32e0b Add leader_pid to pg_stat_activity I had mentioned privately to Julien missing this info in CSV log. Should leader_pid be exposed instead (or in addition)? Or backend_type be a positive number giving the leader's PID if it's a parallel worker, or a some special negative number like -BackendType to indicate a nonparallel worker. NULL for a B_BACKEND which is not a parallel worker. My hope is to answer to questions like these: . is query (ever? usually?) using parallel paths? . is query usefully using parallel paths? . what queries are my max_parallel_workers(_per_process) being used for ? . Are certain longrunning or frequently running queries which are using parallel paths using all max_parallel_workers and precluding other queries from using parallel query ? Or, are semi-short queries sometimes precluding longrunning queries from using parallelism, when the long queries would better benefit ? I think this patch alone wouldn't provide that, and there'd need to either be a line logged for each worker. Maybe it'd log full query+details (ugh), or just log "parallel worker of pid...". Or maybe there'd be a new column with which the leader would log nworkers (workers planned vs workers launched - I would *not* want to get this out of autoexplain). -- Justin