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 1oquDF-0003Ej-7L for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Nov 2022 10:46:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oquDE-0001t1-2L for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Nov 2022 10:46:12 +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 1oquDD-0001sZ-PA for pgsql-hackers@lists.postgresql.org; Fri, 04 Nov 2022 10:46:11 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oquD8-0008SV-4q for pgsql-hackers@lists.postgresql.org; Fri, 04 Nov 2022 10:46:10 +0000 Received: by mail-ed1-x52f.google.com with SMTP id x2so7018851edd.2 for ; Fri, 04 Nov 2022 03:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=kXhhx4cSFNSR+oEIMjBlTY//IhFzoeee1vxklaSDFJU=; b=ppb4YbS/Xn+FhZ2U1v52irFjsqxV3o1UlRhhDntYn/OykgeSIRUTYy0mtZRq9w10YZ BMsL0Jjbc75AOxPW84+WTqsUsaW84VOcmYo0agYmHDh4NUnmMO3vZ1x2AcpBKtzIDgse eCFtlOqkhR+NyYkP94sCDkUOM9k6Pt5upI4lulU1ePNVBiAZUj3U06LuVUBV2QmK9iUc zPdWJKL+dthaGQUu97VOVwUb4W7synziozWUsMvAg0TxRoBzwsHd2yLh+IuuPfDvGRQh eayOvWC+11Hjgx9rif0k75txmP3TP4nAMzPXyCL2NucDcjuRDrLC3LpVEuI6doye7lCx l9kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kXhhx4cSFNSR+oEIMjBlTY//IhFzoeee1vxklaSDFJU=; b=3cQUwfogc873vFW9WhyvS6O5AF+zpd3sx5AbeWuShtYz6UD8HPjcxy0lYikcMOtfJx 2A+oZ/yJ7XuvmufxFzeSndHoT/v0nq/KYLbsjjEgMbk3qAwETrBcRX9AHR/OTAfO7vlR 4TjJyJHWmXLm+kegNaJdRSOxpCLImwQgMKy6/qTh1uD9nVcBPE9CltsdUYvcuVa65yRy wBWbUTfHGcXjMZ9kuFLdexFHaN3scLh/8zJZgwdJc4yYgKYhEBcchtRSGQzAkwp5mUC+ wsysHHTAhsphEIC76faMV1YTLl6uw9ZNmIdZlyx4AZyo3T/Ac75q+FptxO4aZNiwJ2UH dZuA== X-Gm-Message-State: ACrzQf2cluoKJrwQ3CZXsOgofkibZSgWJgRZhzgo6pc6WklqWIsW4gOu 2FUCFKETwQOGj2CoQdJkwWSg/A== X-Google-Smtp-Source: AMsMyM5ryUJNe/fnrSTumZ4WGt7ZLE/07gB+gMVm6kPXQFFdUHce4ZnOsFpPqlR9QzhwEi+0QsNBVA== X-Received: by 2002:a05:6402:11c7:b0:462:549d:fbbe with SMTP id j7-20020a05640211c700b00462549dfbbemr34813729edw.199.1667558764621; Fri, 04 Nov 2022 03:46:04 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:1d8c:788c:407d:490b:9a90]) by smtp.gmail.com with ESMTPSA id k12-20020a50cb8c000000b00456c6b4b777sm1721509edi.69.2022.11.04.03.46.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 03:46:04 -0700 (PDT) Message-ID: <790e175d16cca11244907d3366a6fa376c33e882.camel@cybertec.at> Subject: Re: explain_regress, explain(MACHINE), and default to explain(BUFFERS) (was: BUFFERS enabled by default in EXPLAIN (ANALYZE)) From: Laurenz Albe To: Justin Pryzby Cc: "David G. Johnston" , Nikolay Samokhvalov , pgsql-hackers@lists.postgresql.org Date: Fri, 04 Nov 2022 11:46:03 +0100 In-Reply-To: <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> <20221028225904.GJ16921@telsasoft.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.42.4 (3.42.4-2.fc35) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks for the updated patch set! On Fri, 2022-10-28 at 17:59 -0500, Justin Pryzby wrote: > > > 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). Essentially, "explain_regress" is to simplify the current regression tests, and MACHINE OFF is to simplify future regression tests. That does not seem like a meaningful distinction to me. Both are only useful for the regression tests, and I see no need for two different knobs. My opinion is now like this: +1 on enabling BUFFERS by default for EXPLAIN (ANALYZE) +0.2 on "explain_regress" -1 on EXPLAIN (MACHINE) in addition to "explain_regress" -0.1 on adding the MACHINE OFF functionality to "explain_regress" "explain_regress" reduces the EXPLAIN options you need for regression tests. This is somewhat useful, but not a big win. Also, it will make backpatching regression tests slightly harder for the next 5 years. Hence the +0.2 for "explain_regress". For me, an important question is: do we really want more EXPLAIN (ANALYZE) in the regression tests? It will probably slow the tests down, and I wonder if there is a lot of added value, if we have to remove all the machine-specific output anyway. Hence the -0.1. > >   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). Now it makes sense to me. I just didn't think of that. > 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. You convinced me too. > > 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. I agree with that. I would really like to see 0003 go in, but it currently depends on 0001, which I am not so sure about. I understand that you did that so that "explain_regress" can turn off BUFFERS and there is no extra churn in the regression tests. Still, it would be a shame if resistance against "explain_regress" would be a show-stopper for 0003. If I could get my way, I'd want two separate patches: first, one to turn BUFFERS on, and second one for "explain_regress" with its current functionality on top of that. Yours, Laurenz Albe