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 1jKGze-00044M-27 for pgsql-committers@arkaria.postgresql.org; Fri, 03 Apr 2020 07:43:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jKGzc-0004ro-V9 for pgsql-committers@arkaria.postgresql.org; Fri, 03 Apr 2020 07:43:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKGzc-0004rg-Ng for pgsql-committers@lists.postgresql.org; Fri, 03 Apr 2020 07:43:56 +0000 Received: from mail-lf1-x143.google.com ([2a00:1450:4864:20::143]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jKGzY-0003dn-UA for pgsql-committers@lists.postgresql.org; Fri, 03 Apr 2020 07:43:56 +0000 Received: by mail-lf1-x143.google.com with SMTP id h6so460204lfc.0 for ; Fri, 03 Apr 2020 00:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=SPJxgfSNjQMM0xRn7SKJbaclceCuUKdA69sd3yO8SIk=; b=BKuf9WH5CADrD0yiSPyspzoS+ufHTj8d2mej8kAbDC7Ac8sW+PUItDBsI9nVJsO+z8 MMUxL/d1JaELgaVOCUDWsYr0siQHjmiwXf+jLsPFvmMws9hhd00ohLFe8STCjYKfegUh Gu31mumMWiFvgY3w0377JPGqMTq6P3Dimb8kYoqBx4QkRFW2Hg+LLEZjzDxGlarZUams K3wi44RZwXadjcGi0681CDUAJrjbbQ8HvA3pLdiBKIIKU+EfoY6mFtUol806nVttzyZ8 sMzp9/TaWqjNEiw4E++KHwd7FTu/fRqaF5N7dpZWFAGVB1imZR/Kv8s6f53uqH4CwFfQ unWw== 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; bh=SPJxgfSNjQMM0xRn7SKJbaclceCuUKdA69sd3yO8SIk=; b=M7INovNUQlPGS7egFH6eCCpNg10PSLeiqt4qKHetP1291obejVkB1ovbJgkG8IjFXd uZ8u2PheXEt4ua3dYo1G0z1D+O6bFmrgea3kvitt+pFHz6zCt/iD5tpYU114Qlwn3sxF FyGtNbFb2PXFPZoTJ74nTb0xVCQ3X12tswmq19zwJ3fO07e8soIr55dMAUSiHKT1tuB2 PhT6G2u4/2AxcKjv3KyUMcTYG75VxPoKYZo10FUFP3JkhFwynHHHOMshEFGWvAcziBdb rzhfx65hHO8i4IvbeV8G3qke7ZzF61rpS73XLKxvc9AtbGxVlCOw6NNjqH23/UBLoNUy ILcQ== X-Gm-Message-State: AGi0PuZyNTIANZ4oJkquw2IGv+qELdY6uHrpw7yTNr/w207sVQN9jDAV FC4M2lOIzV5ZH0LgdxCDY/I= X-Google-Smtp-Source: APiQypKYxGlsHq3TxQUVtPIUWfzWDafFtGINwdsxanxvkMXACL7EiG0zdZc4ILveg+rSLrPMhyxQgA== X-Received: by 2002:a19:c752:: with SMTP id x79mr4360485lff.144.1585899831711; Fri, 03 Apr 2020 00:43:51 -0700 (PDT) Received: from nol (82-64-124-11.subs.proxad.net. [82.64.124.11]) by smtp.gmail.com with ESMTPSA id u8sm5459549lfi.12.2020.04.03.00.43.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2020 00:43:51 -0700 (PDT) Date: Fri, 3 Apr 2020 09:43:47 +0200 From: Julien Rouhaud To: Fujii Masao Cc: Tom Lane , Michael Paquier , Fujii Masao , pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Include information on buffer usage during planning phase, in EX Message-ID: <20200403074347.GA1206@nol> References: <20200403025751.GB1759@paquier.xyz> <0fa34bc8-479e-61e8-94c0-9cdbc34ea0bb@oss.nttdata.com> <23095.1585884653@sss.pgh.pa.us> <4ecdae9c-fa0b-17b6-9166-0a45c396da22@oss.nttdata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ecdae9c-fa0b-17b6-9166-0a45c396da22@oss.nttdata.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Apr 03, 2020 at 03:24:41PM +0900, Fujii Masao wrote: > > > On 2020/04/03 12:30, Tom Lane wrote: > > Fujii Masao writes: > > > On 2020/04/03 11:58, Michael Paquier wrote: > > > > prion did not like that: > > > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prion&dt=2020-04-03%2002%3A33%3A13 > > > > dory failed as well. The problem is that in text mode, a Buffers line > > won't appear at all if there were zero buffer accesses. I don't think > > we really want to change that, > > Yes. > > > so probably the thing to do is adapt > > the filter functions in explain.sql so that they suppress Buffers lines > > altogether in text output. Kind of annoying, but ... > > I'm thinking to suppress only Buffers line just after Planning Time line, > by applying something like the following changes to explain_filter(). > Thought? +1, that's a better workaround. > > declare > ln text; > + ignore_output boolean; > begin > for ln in execute $1 > loop > + IF ignore_output THEN > + ignore_output := false; > + CONTINUE WHEN (ln ~~ ' Buffers: %'); > + END IF; > + ignore_output := ln ~~ 'Planning Time: %'; > -- Replace any numeric word with just 'N' > ln := regexp_replace(ln, '\m\d+\M', 'N', 'g'); > -- In sort output, the above won't match units-suffixed numbers I'm not sure of what's plpgsql behavior here, but it's probably better to initialize ignore_output to false. Nitpicking, but I think that planning_time_found, or something similar, would be better here.