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 1msaQi-0007UK-SK for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Dec 2021 00:58:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1msaQg-0007yp-Sb for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Dec 2021 00:58:30 +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 1msaQg-0007xB-5W for pgsql-hackers@lists.postgresql.org; Thu, 02 Dec 2021 00:58:30 +0000 Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1msaQa-0007Gq-2c for pgsql-hackers@lists.postgresql.org; Thu, 02 Dec 2021 00:58:28 +0000 Received: by mail-io1-xd36.google.com with SMTP id c3so33358182iob.6 for ; Wed, 01 Dec 2021 16:58:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ehmiEdpgyWht5Bc588sPtLriKQS6EP+mb7N8aWfIadA=; b=IxbA1wzW9cLtDN1TVetIxPIxtMmGsU2FVeAfa6HbA9XNYnUjvA/Ih7mLxOBqN7HvFc fzj4HKlvqqbLL7UK2+7Xuh4ZJc7Qm6cZqNkiH1cYPTyOiFXRl1jgdKwvC7ML99I9V7jJ t6dQyZmgbpz/1GARyz7R9lxKmiNbZNKdgfm1hO2MMAKF7q+ZYKtJIbytOJJTvcPN1+iM vhebBFBVL8zJpowzqr8kMy9dXPDj0UAocbGZrSMgXj6OoVHWko7zuDCnrTNNZ/m1ndBL aP8fMcn4s5uh2b+9UGv76vo/CKPi2ZgBJbC55tn9T8r4ZQsDKRijUL22y1Y/PKjqgG0T QYkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ehmiEdpgyWht5Bc588sPtLriKQS6EP+mb7N8aWfIadA=; b=CnAWAwjqfswHY9NsQgsOBxMn/Ob8IBww+8Xp/1CN6lyUS4U3CO2NpjXw/qQZfAMJhM S2VqbA1UKe5Szdd5TMgZck4vkLMMOekXJkyNWGP6BVONvT7xEIM3PsvcG8MbW0H61Bq2 tM897tsF6tBP58sSe0+wXR/rxX+WklcWgMcqWub4Um/YlCSidz+JV7HJ22wM3yP37mND MEADvR0Slu7DZ4yLBQJac8dciNUPBlvg1yaheaOKQL56rSP/Kh8U1Ye2o8wipfBU7J1w fb812paPrXs8/VFSZVjjvl1H7Ri1InkAwk1O36Vl/moXFFMPErP/xD9M5OLsNIqqzQ9v KLeg== X-Gm-Message-State: AOAM531KJvN5D3czfcLJ0WhBC6L4nlj3fA/BgyvFIkJUY2N+MYGLhHJQ tWiBteraXq4mUg7q7twqM5Rs0gGRaOv/mw== X-Google-Smtp-Source: ABdhPJz4T6cm0PxdVl23zxzZhBSxYbdV8w0iX96tYEw2LyaRNZtR77k1LPZUe2LuuELCWMh7Pmot7g== X-Received: by 2002:a05:6638:dd5:: with SMTP id m21mr15483004jaj.44.1638406702871; Wed, 01 Dec 2021 16:58:22 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id m14sm959830iov.14.2021.12.01.16.58.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Dec 2021 16:58:22 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id F114280084D; Wed, 1 Dec 2021 18:58:20 -0600 (CST) Date: Wed, 1 Dec 2021 18:58:20 -0600 From: Justin Pryzby To: Nikolay Samokhvalov Cc: pgsql-hackers@lists.postgresql.org Subject: Re: BUFFERS enabled by default in EXPLAIN (ANALYZE) Message-ID: <20211202005820.GJ17618@telsasoft.com> References: <20211115190954.GO17618@telsasoft.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MOLI6A2k/lnHENyK" Content-Disposition: inline In-Reply-To: <20211115190954.GO17618@telsasoft.com> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --MOLI6A2k/lnHENyK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Nov 15, 2021 at 01:09:54PM -0600, Justin Pryzby wrote: > Some time ago, I had a few relevant patches: > 1) add explain(REGRESS) which is shorthand for (BUFFERS OFF, TIMING OFF, COSTS OFF, SUMMARY OFF) > 2) add explain(MACHINE) which elides machine-specific output from explain; > for example, Heap Fetches, sort spaceUsed, hash nbuckets, and tidbitmap stuff. > > https://www.postgresql.org/message-id/flat/20200306213310.GM684@telsasoft.com The attached patch series now looks like this (some minor patches are not included in this list): 1. add GUC explain_regress, which disables TIMING, SUMMARY, COSTS; 2. enable explain(BUFFERS) by default (but disabled by explain_regress); 3. Add explain(MACHINE) - which is disabled by explain_regress. This elides various machine-specific output like Memory and Disk use. Maybe it should be called something else like "QUIET" or "VERBOSE_MINUS_1" or ?? The regression tests now automatically run with explain_regress=on, which is shorthand for TIMING OFF, SUMMARY OFF, COSTS OFF, and then BUFFERS OFF. There's a further option called explain(MACHINE) which can be disabled to hide portions of the output that are unstable, like Memory/Disk/Batches/ Heap Fetches/Heap Blocks. This allows "explain analyze" to be used more easily in regression tests, and simplifies some existing tests that currently use plpgsql functions to filter the output. But it doesn't handle all the variations from parallel workers. (3) is optional, but simplifies some regression tests. The patch series could be rephrased with (3) first. Unfortunately, "COSTS OFF" breaks postgres_fdw remote_estimate. If specifying "COSTS ON" in postgres_fdw.c is considered to be a poor fix , then I suppose this patch series could do as suggested and enable buffers by default only when ANALYZE is specified. Then postgres_fdw is not affected, and the explain_regress GUC is optional: instead, we'd need to specify BUFFERS OFF in ~100 regression tests which use EXPLAIN ANALYZE. (3) still seems useful on its own. --MOLI6A2k/lnHENyK Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Add-GUC-explain_regress.patch"