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 1mmhMi-0007Kr-PU for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Nov 2021 19:10:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mmhMh-0006lN-PC for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Nov 2021 19:10:03 +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 1mmhMh-0006lE-60 for pgsql-hackers@lists.postgresql.org; Mon, 15 Nov 2021 19:10:03 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mmhMc-0007tW-B0 for pgsql-hackers@lists.postgresql.org; Mon, 15 Nov 2021 19:10:02 +0000 Received: by mail-io1-xd2f.google.com with SMTP id w22so22860002ioa.1 for ; Mon, 15 Nov 2021 11:09:57 -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:content-transfer-encoding:in-reply-to :user-agent; bh=385hElVTkvd3O7U9zvZs0wU7aylEm8tDS/c4hfUYV9w=; b=6jV5QUjaHmH7I0gQlvU+33tVIpM5Zeal1vEK2t2q7jmhBXQpRhhpKEomJQ8d9jaZ5O 7cAzM+tQ9cxQVDRz2prkFAGehilKmkR9b6Fsxub14FattfdGqXIGj/EKmF9o5YTrltxV m0ry0cCi/zqUacbc8O2kXHxSW1H2felG1cc2Q2tiePpk0+5KomvacOSZblVWaAzXLgsl UuCkBYenmiMttDPjXnA3BKomV3HPFYjIznBZB0QajGKZiNrfvo0r++Y1yyrki+ctHSSc kOySp7icqD9/BNnW+1u3waJ/ShBNUfwIDcXxax0xj7r9Rb0/wDPatTo5EwDDe7Vo5ZbN LYdA== 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:content-transfer-encoding :in-reply-to:user-agent; bh=385hElVTkvd3O7U9zvZs0wU7aylEm8tDS/c4hfUYV9w=; b=XSvgqSJjiuwJLGPPlqvcLYf6Nk7FTcFzaAvUaNNwjBYSAber7VGlhnW0u2cqIowUcU LixTghtw85ZJHR+wUO6xGXlyVG8MxdDeEubt1Xwtk/uAkxOF9cjbk/5HkKF4j5U5fsAx dXePxSC4oeDFy4UxH4znSX0kABl6xXSGkUc901HGyZLVl5eFiHC1hhAMN562xhl5suoG KB2vT+/0Z8m6D8JeMsXfvDTuzhRwoYh2KW+Gp8MCHM9S7mkYlQ2VVS3Mb1dtbsvXMs+8 xuftnagfg+aFtmKromqerLcoIJ31da4bGldSvN9BAFK7L2907tj922s5Kn+RSgVzkkcp +NUg== X-Gm-Message-State: AOAM532AKP+Ks/xhAz5Ni/bHOw8EPDxeaH+SQ/fumGzxVqHpEVg1+d5P 6LNbbaEkSL+7FT09jIaGfbR5pg== X-Google-Smtp-Source: ABdhPJz0wz1uzjP50y9LwxDh5gFZArdcv7mhoTH31ANSShbd1bNWs7VscbE2DSX41Gkjo/MvQ5VbfQ== X-Received: by 2002:a05:6638:2608:: with SMTP id m8mr783645jat.57.1637003396148; Mon, 15 Nov 2021 11:09:56 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id t6sm10397627iov.39.2021.11.15.11.09.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Nov 2021 11:09:55 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id CA4B780076C; Mon, 15 Nov 2021 13:09:54 -0600 (CST) Date: Mon, 15 Nov 2021 13:09:54 -0600 From: Justin Pryzby To: Nikolay Samokhvalov Cc: pgsql-hackers@lists.postgresql.org Subject: Re: BUFFERS enabled by default in EXPLAIN (ANALYZE) Message-ID: <20211115190954.GO17618@telsasoft.com> References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Q/AGl/UrDvkbRExF" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 --Q/AGl/UrDvkbRExF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Fri, Nov 12, 2021 at 02:58:07PM -0800, Nikolay Samokhvalov wrote: > Re-reading the thread [1] (cannot answer there – don't have those emails in > my box anymore), I see that there was strong support for enabling BUFFERS > in EXPLAIN ANALYZE by default. And there were patches. Commitfest entry [2] > was marked Rejected because there were questions to the implementation > based on GUCs. I think the only reason this isn't already the default is because of (3): > 3. How to adjust regression tests? Of course, now many tests fail. Same > question as for documentation. Excluding buffer, numbers would be an easier > fix, of course – but at least some tests should > check the behavior of BUFFERS (such as both default options – with and > without ANALYZE). 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 > 1. Should BUFFERS be enabled for regular (w/o ANALYZE) EXPLAIN? Now it may > make sense because of the buffer numbers the planner uses. This patch > doesn't do that, but it definitely may make sense because it can help > people understand why planning time is so big, in some cases. I think it *should* be enabled for planning, since that makes the default easier to understand and document, and it makes a user's use of "explain" easier. However, that makes this patch series more complicated: explain(ANALYZE) is rare in the regression tests, but this would affect the output of bare "explain", which affects almost every test. I think the answer to that is to add a GUC (as Tom suggested in an old thread) like explain_regress=on, which causes explain to omit these details. This would be instead of my explain(REGRESS), and would change the defaults of various params in a central place, to avoid the need to update many regression tests. In the future, this might also handle the stuff that my "explain(MACHINE)" attempted to handle. I've rebased my patches like this. I think the explain(REGRESS) should be re-written as a GUC which is set by regress.c. I'm interested to hear from a reviewer if this is worth pursing like this. -- Justin --Q/AGl/UrDvkbRExF Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Add-explain-REGRESS.patch"