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 1tplXx-00BjqY-5k for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Mar 2025 10:00:13 +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 1tplXv-006kUs-OM for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Mar 2025 10:00:11 +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 1tplXv-006kUi-EB for pgsql-hackers@lists.postgresql.org; Wed, 05 Mar 2025 10:00:11 +0000 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tplXt-0015Hc-1s for pgsql-hackers@lists.postgresql.org; Wed, 05 Mar 2025 10:00:10 +0000 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-390effd3e85so5073155f8f.0 for ; Wed, 05 Mar 2025 02:00:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741168808; x=1741773608; 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=MfS0UWsmJGoeztOsF1PZrVmQwfqAWz1pr8cUmq/lIK8=; b=SneYCSIUBa67CChpVGbI00PbWTJ8HH8Q3kPPJ1s9vZR6TXhrHCfW8QMQmcfXgWLH3z tmnCXcCW9I+u/hA1shNq+trXX/Js0U5KLDf5ebVzvZUZ+T3CVRM5En3RAvp95HSrnIQn AXISUksIz57XXbKvoLnKLnccRqx1TJXOeeZ03kvh2ow6ctHYEsjjguJpIq8PgFfrxA7e d4aHJLaW4iCWJFLJ15dLYsjegXHswg8jZqbLobCswFyyPg6rPeycuMxS20C4KI2aDbmf 4fNAkMwL7pvUPKr4JaAumdeYfAAh5qP95F3m/Qd5GfLOVzQR/frajQ8u9Ar2yIorYZAv 8ZWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741168808; x=1741773608; 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=MfS0UWsmJGoeztOsF1PZrVmQwfqAWz1pr8cUmq/lIK8=; b=KQIYFCKV59xzkUDHVUmhieVIlN7eAOwsOi6aTTEB9Ni5dQEiJ/+1sLz/s5LngwSnz/ +n0jn7S42piUfJGJ502MJbAFYaRGlelkEw2+Bn1ewsUSS+ofgTBJtWsx059g2fuVvgzD 9I+BDPdFjFMemTJDNqbbQ4IcuM1oLDnEnn+oS6rXb2kThZoXp4DgEJc5DbYz7l3P1P/r 8rtHYIRFeicv83R5sHudBtNCg61IIibNtNTu0icqLEoFqiTqiPR/A2Vmr2E/ljDUsPXs 0vR1fYat2Zo/mlbzwF/0KbjYyJiyWUYhXRPQ9WvIghSHsXL0Un5MiNM2ZIg3GxY/5N/v h99w== X-Forwarded-Encrypted: i=1; AJvYcCVXdVKJsusTW421i2v9k3JBQVWiEQzIlrvYwfQlMkAMVplgkfH4uRWNaQwQNcPdnhnr+J1AuZidd+lCMgZH@lists.postgresql.org X-Gm-Message-State: AOJu0YybnwkEtLg3m/iIBiA0fxPanfEvoFHE5P4w2+rcZ6PnyV7NsFgy sUeVdifDE+tRPbi5Y8HgHE7rkJ0YFZGc70rb6tFlNZ3YGoH+qV+r X-Gm-Gg: ASbGncsi9v6W/S0ztTCRaIBS7e+0VTMDvZsRgWCUV2xdPsPkrMOnsjOviMrOZtRSvmx i1sZJ8FWA293VXvOS8nrmzDEmoptx8HKa7MriDX3Hj7AmBqnmCVNnZSKT9s8w/JhzuV6q+0pLmk EL94xDCkMyFdyN307nyEXR6fKO8C+qsqG+kW8t6iKL3YMHfgYj+IkTkPaQTK4n65jz/6LYcwvYU tfgj5mObZRHCb/Lqi+O3fCFfS5amVHDTHhpfpGFUJ1N5mwrKDkpFIcpksywejpkmBXPymX74xuQ VLtX4nhYpVcnyMZrZ9XmzYY/cS2UQozYs8AGDAt8z1UCG3YtBAWxRQ== X-Google-Smtp-Source: AGHT+IFHOnz73wA4vlDva5+hLDkHMDW9Y1L0ty3K5C35gOlGtjGE+B5j/pTB9L9Z8wJL5SBkgz9jgw== X-Received: by 2002:a5d:6d04:0:b0:390:ffd0:4135 with SMTP id ffacd0b85a97d-3911f729c53mr1313322f8f.20.1741168808044; Wed, 05 Mar 2025 02:00:08 -0800 (PST) Received: from [172.20.10.2] ([31.4.241.133]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390e4795d44sm20216907f8f.8.2025.03.05.02.00.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 05 Mar 2025 02:00:07 -0800 (PST) Message-ID: <8939a81a-abaf-46d2-bf1b-077fe186acbe@gmail.com> Date: Wed, 5 Mar 2025 11:00:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: making EXPLAIN extensible To: Robert Haas , Jeff Davis Cc: Thom Brown , PostgreSQL Hackers , Yurii Rashkovskii References: <5bbca514250c1f8ee45f08ada94184b0ae109fe9.camel@j-davis.com> 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 4/3/2025 22:23, Robert Haas wrote: > On Tue, Mar 4, 2025 at 1:53 PM Jeff Davis wrote: >> I don't expect there to be zillions of extensions that only add new and >> exciting explain options. Instead, it seems more likely that all >> TableAM and CustomScan extensions will have 1-3 new explain options, >> and that some of those might collide. For example, several may have a >> EXPLAIN(PUSHDOWN) option that explains what work is being pushed down >> into the TableAM/CustomScan. >> >> In that case it's not even clear to me that a collision is a problem. >> Would you really only want pushdown information from extension A, and >> be upset that it also emits pushdown information from extension B? >> Maybe we should just allow multiple extensions to use the same option >> name? > ... > Actually, I don't think custom scans or table AMs are the design > center for this feature. Keep in mind that, for a custom scan, we > already have ExplainCustomScan as part of CustomScanState->methods. We > don't currently have anything similar for table AMs, and you could > work around that with these hooks, by checking every node to see > whether it's a scan node and if so whether it scans a relation that > matches your table AM, but it would probably be better to have a > method for it, similar to what we have for CustomScan, if this is > something people want to do. It would be more efficient and require > less code. +1. In my experience, ExplainCustomScan has always been enough for the CustomScan node. As for extensions collision - for now, it would be better to treat extensions as independent actors, suggesting that the developer, designing a software solution based on an extensions' constellation, will arrange their behaviour during development. For instance, if your library exports a function or variable, adding a prefix is essential to prevent overlapping functions when another library is loaded. I recall that Yurii Rashkovskii is a proponent of using multiple extensions within a single installation. Perhaps he has insights on this topic? -- regards, Andrei Lepikhov