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 1uI6Jk-00FjrI-TQ for pgsql-hackers@arkaria.postgresql.org; Thu, 22 May 2025 13:50:40 +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 1uI6Jj-002W9x-M5 for pgsql-hackers@arkaria.postgresql.org; Thu, 22 May 2025 13:50:39 +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 1uI6Jj-002W9o-CZ for pgsql-hackers@lists.postgresql.org; Thu, 22 May 2025 13:50:39 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uI6Jh-000Jgl-0T for pgsql-hackers@postgresql.org; Thu, 22 May 2025 13:50:38 +0000 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-601956fa3beso9171288a12.0 for ; Thu, 22 May 2025 06:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1747921836; x=1748526636; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GgKvaeFDmlTJQYoaBAYJchGZAjOKAWrztNDH326OSBs=; b=hmO0PEZM6hE/pZW44b4GAW0dZMv52CZlmzRz8UIw7Rf5yxHK0f7T4fOK27XxncgwOr j9Zn97PzUCl7BDNAdMW2JO5soF+XUbLt7p0mqkED6rOfHyuJtq7xLnXavxdMfymS1zpB gRIAsDzNRIuQl9RIPwEvWlZ+tJpdIksPnHq7f/CIplwnfFGECpUfkbh/wSavF86O0Tua 0SXK634IOo8YxNfhvB9NQbPmm/Sm8hkPIOyLlENxDNmyATQuNBZ3nvZLlMy2qnCLMoL1 gDm9ZxbvM0zgH8vCHjhBUPWmkOb1o+2lfEUqOtz5OmxwRnRhuvMJumJt3V5ogALBULku vnTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747921836; x=1748526636; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GgKvaeFDmlTJQYoaBAYJchGZAjOKAWrztNDH326OSBs=; b=bqiPr9K9XQXTFQ4lNqJRQM7JW+hVH1mPwB4M8SR3ts+3fvJIuri4+WdIcKXHI1aLi6 y7VF+l8IbR4UF9cd68iOb9HMjo0TCSijml8423Fi0olSLKSE4d9XOjvjtxtWNEqZGuI+ FQrEzLzeMT09KJClwoCWe2qYh2ynjApeaOnO5cXepVJNciH4SE/JXacCpB9JMRa+5iah QGD0Dl/4+bnbXovZTolYnZ00o1rQndmCzkLi9PsY5GK8I96jRqTjTwWqrohY39CVpQLJ Qx599Hb+c5shxmToO1Qhm8CCwFgIL8/DdO4KOY0XLX+TfoIGDAcrE0EP4hueGzfoAk4w ug8w== X-Forwarded-Encrypted: i=1; AJvYcCUrGpJSlRJo4G9FeWn3yiVgdbhIdli+bB+nAU2x1E4JNwJd9ZmeC+S8zMcsXmaiGTVuG6elhrPnvHBBQkam@postgresql.org X-Gm-Message-State: AOJu0YzGNhnvij2p844iUa5cMtPPBsn/axxdUF/yTWIGIuQMOFCKnvWz XU/0Mt0yLE+pvJUH/S8mNbbEIslcIFB89FS1/tjr0MJMdLIFriccS0sirZXfDDFfNlNpwAvIigi v7KmkXSmdDqrNduEuwXnvNXwS54pKC2kbKg== X-Gm-Gg: ASbGncuWadsDs6fY9WMn/Y3315rWcUn79wNps/PZTofeqJ1E/k543HGgACvOEkSSMtY aM5TJIIrFOh3F3hYCrWHTdAjWF7BOf4cZuf8577V17u4s0o4S+HP1+pqPK6dZxgcSzzR7Sv/6OD H0k8oBOqK3O2+/Xig6dc1atZRVlsil6Jfw X-Google-Smtp-Source: AGHT+IEdfvxGHi5hGWnObs9FolqAn+pPeOwxQ4PN+hqtv2exMQpekTociXoz8mDAH8M/FSgMcm9eUCFPRIg7sp9yUeM= X-Received: by 2002:a17:906:6a29:b0:ad5:840c:dda7 with SMTP id a640c23a62f3a-ad5840cdf4amr1105554666b.21.1747921835728; Thu, 22 May 2025 06:50:35 -0700 (PDT) MIME-Version: 1.0 References: <54c35fb9-da3a-4754-ab8c-46ed0b612465@vondra.me> <684c70d7-180e-461d-9377-600c2db581ba@vondra.me> <605328.1747710381@sss.pgh.pa.us> <691261.1747755511@sss.pgh.pa.us> In-Reply-To: <691261.1747755511@sss.pgh.pa.us> From: Robert Haas Date: Thu, 22 May 2025 09:50:22 -0400 X-Gm-Features: AX0GCFv9gxq_MH7WRb8PZoH9_i-8s8uRZ59tdVljvqN8tGL3dTL3QvLodcnOEKQ Message-ID: Subject: Re: generic plans and "initial" pruning To: Tom Lane Cc: Amit Langote , Tender Wang , Alexander Lakhin , Tomas Vondra , Alvaro Herrera , Andres Freund , Daniel Gustafsson , David Rowley , PostgreSQL Hackers , Thom Brown Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, May 20, 2025 at 11:38=E2=80=AFAM Tom Lane wrote= : > I still like the core idea of deferring locking, but I don't like > anything about this implementation of it. It seems like there has > to be a better and simpler way. Without particularly defending this implementation, and certainly without defending its bugs, I just want to say that I'm not convinced by the idea that there has to be a better and simpler way. We -- principally Amit, but also me and you and others -- have been trying to find the best way of doing this for probably 5 years now. If you do something during executor startup, you have to be prepared for executor startup to force a replan, and if you do something before executor startup, then you're duplicating executor logic into a new phase that needs to communicate its results forward to execution proper. Either approach is awkward and that awkwardness seems to inevitably bleed into the plan cache specifically. I'd be beyond delighted if you want to help chart a path through the awkwardness here, since you know this stuff better than anybody, but I am skeptical that there is a truly marvelous approach which we've just managed to overlook for all this time. --=20 Robert Haas EDB: http://www.enterprisedb.com