Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tv0AM-00FL42-Fm for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Mar 2025 20:37:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tv0AL-00BMV0-5J for pgsql-hackers@arkaria.postgresql.org; Wed, 19 Mar 2025 20:37:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tv0AK-00BMUs-Sd for pgsql-hackers@lists.postgresql.org; Wed, 19 Mar 2025 20:37:28 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tv0AI-003rad-2D for pgsql-hackers@lists.postgresql.org; Wed, 19 Mar 2025 20:37:27 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-39141ffa9fcso24039f8f.0 for ; Wed, 19 Mar 2025 13:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1742416644; x=1743021444; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6pDzMFztDGng65K94JosLOA6ztP/ck9XaEAoF7h33iA=; b=d2LEhnOgbG8/9jejd8KF6TRnv03L3vYgj2OdhRVLW8fotq4+AXjVdoj64gHE2P+hRR G53F5k7NoORs1NAMzTHe6WFij4jVi9aFSa2djRdT2yo5zhAOHC8yNAIkri7c3bWXS/mG Vp+oSt4IlcHwi0jETW+DOpiaGYgFHVAtzgqbM/bhi/LolTJxpRoGVr3jbXtRCaHmZenQ mUJ1L0KcirP/tvunP+IXOJetwGacpUiP8WjlJPFlWitGnnjPzx8w+tBhYwcLkXl3rSKx 4WprvniEgFhneNYXPl89EEsQYeQbdf2YwpkRCq9cQVy7DNECKm85HtlrJ/3t/Vn/WVwA VqIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742416644; x=1743021444; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6pDzMFztDGng65K94JosLOA6ztP/ck9XaEAoF7h33iA=; b=ewDsFyevXwsHeNPbfsJ0nwFJ2Y8CUkttgMpv9uV1Z/z8+JZ4O3oO4b8Ervgf4rIuxh YmDnC6vFhE941ssbtYD1uUZSs0+Do7Uic4Xvl4Umrx4l8xZzeQuxN0Hrk4GVd/NNdY/n 7Qog+c+ceHsLyzvr+bo+EPW0wQrS8UUcmkJ9ll6DLhtiAwDyaDgmxmLx543tFjqHLGNZ VHed6Dz7MFfVp6u7gNBmKbRa8UtFE+aqa0y9+iOq//a4USNO7AnjJtEJbAbd6qIRIotP ji/Q/USdSWB7t2VvbwrY4vYe8OCTf6NIzFNDRObQBmj5VQDY2aV/LfsyidTtDTgNq1ka BYOQ== X-Forwarded-Encrypted: i=1; AJvYcCW+KBiDPwBLD7i4oc7B+FKCxeTOQop9EIOM3dJnLgG/whQcZGLjB8daDrrriduSzZnIGpIZiXWF03ZrqA52@lists.postgresql.org X-Gm-Message-State: AOJu0YzuQb8blk8GZYxK4RtHUZXa38uW2lUh60Fr+aIyxTTER92yXk+z lvgnvm/QkCc3M2m/tljE9HtPneOuMdcqILlyYBw7S6h/URZabVZS X-Gm-Gg: ASbGncuAk2mSzg/cY/7vvB3Yd1C6qpkjqm1hnbQWbLsMKYFAg7ET/7RV5/gjOS2Oaac ruy3mmSz4PyiIZLTRlIqXcgYG/Em/3WQuX4S9Hk8xrQzWwfzPfC9byZ85vnSi5VoTufUYhNEVak Wgygct9LolslUtECBSAdNttwciw2KLTdw6bjMmboNZKoCIIyC/FPYjV8e8ZQnnN3I0x6+dRErAY rUiea3rd/dGQ8fBD0VcKixqYwTYqNH4jGqGrZODslQNHp0WMakYf0wHLLS19jBznhYDlyI8Eatw YE1Gezrpxdv9U1pAfN8l9ZKwMOgq4wPHDObmSjch0Jcxjlr3U/i5 X-Google-Smtp-Source: AGHT+IFL5Z1wwsSlUq342t1vUcjHe1709tJhVg2v3VnZdjrODrqE9/XU4GR/VVcWbl7kqe9hubSJyA== X-Received: by 2002:adf:a1d5:0:b0:399:6ad6:34 with SMTP id ffacd0b85a97d-39973af938bmr4209084f8f.35.1742416644298; Wed, 19 Mar 2025 13:37:24 -0700 (PDT) Received: from [10.59.3.23] ([90.121.90.131]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3978ef9a23bsm17644362f8f.15.2025.03.19.13.37.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Mar 2025 13:37:23 -0700 (PDT) Message-ID: <2c9376aa-9c66-4662-9803-3d9bc2afead1@gmail.com> Date: Wed, 19 Mar 2025 21:37:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: making EXPLAIN extensible To: Sami Imseih , Robert Haas Cc: Tom Lane , Jeff Davis , Thom Brown , PostgreSQL Hackers References: <2234935.1741809008@sss.pgh.pa.us> Content-Language: en-US From: Andrei Lepikhov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 19/3/2025 18:41, Sami Imseih wrote: >> On Wed, Mar 19, 2025 at 11:38 AM Sami Imseih wrote: >>> ... as I made the hook signature match that of >>> ParseExplainOptionList, so both pstate and the options list >>> are now available to the hook. >> >> This version LGTM, except it's not pgindent-clean. > > ugh, sorry about that. ran it for both modified files and it found one > indentation correction from v2. > >> index 1d4be3c18ac..8fe1ca5c73e 100644 > 38c38 > < + (*explain_validate_options_hook) (es, options, pstate); > --- >> + (*explain_validate_options_hook)(es, options, pstate); > 59c59 > < 2.47.1 > > v3 attached. I want to criticize this patch a bit. ;) Why do you think this hook is not redundant? May we avoid it at all? It seems to perform a too-narrow task. For example, if you want to separate parameters that may be used on a plain EXPLAIN and on EXPLAIN ANALYZE to get behaviour like the following: EXPLAIN (BUFFERS ON, TIMING ON) SELECT * FROM pg_class; ERROR: EXPLAIN option TIMING requires ANALYZE It would be better to add the parameter "type: EXPLAIN_ONLY | ANALYZE_ONLY | BOTH" to the RegisterExtensionExplainOption() routine. This value will be saved inside the ExplainExtensionOption structure and processed by the core inside the ParseExplainOptionList. > ERROR: EXPLAIN options REMOTE_PLANS and ANALYZE cannot be used > together I think the additional parameter covers the case you provided, isn't it? -- regards, Andrei Lepikhov