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 1ooYJr-0007v0-W2 for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Oct 2022 22:59:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ooYJp-0004Zl-NO for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Oct 2022 22:59:17 +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 1ooYJo-0004Zb-Og for pgsql-hackers@lists.postgresql.org; Fri, 28 Oct 2022 22:59:17 +0000 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ooYJh-0001Bi-Hv for pgsql-hackers@lists.postgresql.org; Fri, 28 Oct 2022 22:59:15 +0000 Received: by mail-io1-xd30.google.com with SMTP id p141so5815359iod.6 for ; Fri, 28 Oct 2022 15:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=R0TV+zUWToAU4sKisW8mdEgZfVYgRTn3SqZEDiajcdE=; b=JD4hTV14WJquZGW+2MQ4PRkimxPjS4YiPjHAQosw6gU8+xuG2fqJXBO4qtuCbrMFI3 TOFfI+i/D2nDiCExC2W9umeYk5hDUHzXjWgCE8gspfZnBKcoE0KIsM7XxDXZ68rRLkNM FCuZ4YVxroOFmWYNS+rFfvPiwI+JFE5VFtYJm8Dfhlo071Pc/LoEWZ6ZY8QcpIRWMkaS twUQQFsMCg5mF+0hsngYo5/QVXXLv678CTHKe+UjswiZWwhd+BW6pY/PwS1xsqCjKbCE LsjqQZmO3Uoo+i9Y056WVzZKbvNljrXkU4MQPOA+gC/tHoOkWk0NX51oyMVdbIFFoaP9 FaMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R0TV+zUWToAU4sKisW8mdEgZfVYgRTn3SqZEDiajcdE=; b=Zl4EFMB8CxsmTGyz7BaA0pgVFUJtObuNC6rszTTxHq5A01Zi1a1xRiJF/+Tg4Z++iT t1XJUcBAqLN9RxRonG7iqrt48fF+9d+gvmZI/wPpC2EA6rCdD9fou3mHdv92gkccyTYU VzSp5pKC0fq1uz6vJB9icfmVPaE5EHJLVxH9Jfm2T27Nb5ccQ9Aix5QwBe9McAsD8Res BzFEFprja/TW7af7JBlikIHwqs07FvO6KhHsmYJezLg9dAUvLaRWwO8sZbpRFiBgm/N5 Mnp1x9gEdWMJj0U87WcteJd1CUqJpSC+ikPutrBMu1hFC7ehZzACJR04fxhl9Vs/asga Vdzg== X-Gm-Message-State: ACrzQf102V2MPKVAWd1XPs97p0iSrnRg6OjeyTWprNIMwUpbAe3vlunK tzWrmTRwKu0ayjb5N3itXdG0Gg== X-Google-Smtp-Source: AMsMyM6AQN7QPijS8/cBA1b2uRNlb7neRd7ziQ5C9sk4OW9X0j2vfw1HzSeM1LeJ1YClzrqg2eplaw== X-Received: by 2002:a02:9386:0:b0:373:6f8b:10a5 with SMTP id z6-20020a029386000000b003736f8b10a5mr962908jah.0.1666997948167; Fri, 28 Oct 2022 15:59:08 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id y3-20020a056638228300b00363e61908bfsm2192530jas.10.2022.10.28.15.59.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Oct 2022 15:59:07 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 10996800D87; Fri, 28 Oct 2022 17:59:05 -0500 (CDT) Date: Fri, 28 Oct 2022 17:59:04 -0500 From: Justin Pryzby To: Laurenz Albe Cc: "David G. Johnston" , Nikolay Samokhvalov , pgsql-hackers@lists.postgresql.org Subject: Re: explain_regress, explain(MACHINE), and default to explain(BUFFERS) (was: BUFFERS enabled by default in EXPLAIN (ANALYZE)) Message-ID: <20221028225904.GJ16921@telsasoft.com> References: <20211115190954.GO17618@telsasoft.com> <20211202005820.GJ17618@telsasoft.com> <20220124173548.GV23027@telsasoft.com> <20220905112031.GF31833@telsasoft.com> <20221021020934.GA13372@telsasoft.com> <033ff31aeeb5d0bb49a8e85df32d34e032ab5729.camel@cybertec.at> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="XJ5wUQMT/jAb5xue" Content-Disposition: inline In-Reply-To: <033ff31aeeb5d0bb49a8e85df32d34e032ab5729.camel@cybertec.at> 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 --XJ5wUQMT/jAb5xue Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Oct 25, 2022 at 03:49:14PM +0200, Laurenz Albe wrote: > On Thu, 2022-10-20 at 21:09 -0500, Justin Pryzby wrote: > > Rebased. > > I had a look at the patch set. Thanks for looking > @@ -2288,6 +2288,7 @@ regression_main(int argc, char *argv[], > fputs("log_lock_waits = on\n", pg_conf); > fputs("log_temp_files = 128kB\n", pg_conf); > fputs("max_prepared_transactions = 2\n", pg_conf); > + // fputs("explain_regress = yes\n", pg_conf); > > for (sl = temp_configs; sl != NULL; sl = sl->next) > { > > This code comment is a leftover and should go. No - I was wondering whether the GUC should be specified by the environment or by the file; I think it's better by file. Then it also needs to be in Cluster.pm. > 0004, 0005, 0006, 0007: EXPLAIN (MACHINE) > > I think it is confusing that these are included in this patch set. > EXPLAIN (MACHINE OFF) is similar to "explain_regress = on", only it goes even further: > no query ID, no Heap Fetches, no Sort details, ... > Why not add this functionality to the GUC? Good question, and one I've asked myself. explain_regress affects pre-existing uses of explain in the regression tests, aiming to simplify current (or maybe only future) uses. And is obviously used to allow enabling BUFFERS by default. explain(MACHINE off) is mostly about allowing "explain ANALYZE" to be used in regression tests. Which, right now, is rare. Maybe I shouldn't include those patches until the earlier patches progress (or, maybe we should just defer their discussion). > 0005 suppresses "rows removed by filter", but how is that machine dependent? It can vary with the number of parallel workers (see 13e8b2ee8), which may not be "machine dependent" but the point of that patch is to allow predictable output of EXPLAIN ANALYZE. Maybe it needs a better name (or maybe it should be folded into the first patch). I'm not actually sure if this patch should try to address parallel workers at all, or (if so) if what it's doing now is adequate. > > BTW, I think it may be that the GUC should be marked PGDLLIMPORT ? > > I think it is project policy to apply this mark wherever it is needed. Do you think > that third-party extensions might need to use this in C code? Since v15 (8ec569479), the policy is: | On Windows, export all the server's global variables using PGDLLIMPORT markers (Robert Haas) I'm convinced now that's what's intended here. > This is not enough. The patch would have to update all the examples > that use EXPLAIN ANALYZE. Fair enough. I've left a comment to handle this later if the patch gains any traction and 001 is progressed. -- Justin --XJ5wUQMT/jAb5xue Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Add-GUC-explain_regress.patch"