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 1tlJtv-00AzmN-Px for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Feb 2025 03:40:31 +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 1tlJtt-000oSv-8l for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Feb 2025 03:40: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 1tlJts-000oSh-Vf for pgsql-hackers@lists.postgresql.org; Fri, 21 Feb 2025 03:40:29 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tlJtr-00216G-11 for pgsql-hackers@postgresql.org; Fri, 21 Feb 2025 03:40:28 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-220c8cf98bbso35442335ad.1 for ; Thu, 20 Feb 2025 19:40:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740109226; x=1740714026; 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=c+RvoRXERMD0Vg/UE1EsHD68/om084X8HyDJCj3KvEk=; b=fA6T4gbdBYNM0YIa7TppFzXhAKkEgbzN3m8idnzgirqovB1KTMOs6Knct31fcCLyIE duBcr2MMnBqM2VyVax/0BoTzi3OjQffvS8+ND7XwxURFts2hOqHZFrb5BmymdKEWf4s4 h5Qdc+lVHOx2/qj6DlEM6OL2IyCn0K0L2arZcQVD0RVi8TefVeYc0l0yksUFHWk5uZf1 nJw+Bg7cwSupd4T9XcxYeiwMuEO/emLB+H6POWQSTtT2yuvtmtNGbKXkvtu4jxi0dOqb Om0s+jDttjldRV/sZGKnTnncII1QFviyf4MaSh8KHdP/e+OLc78uuszgsEB1O6fag0mA lULg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740109226; x=1740714026; 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=c+RvoRXERMD0Vg/UE1EsHD68/om084X8HyDJCj3KvEk=; b=MXzyEQNa83RT44METSO621oRQ40rSVAPx9L9QBOCheUZJLD0gIJxfw7aX42LBdHnie guhcbbgcsS5SvCLA5HfSewepR2uSsqw4jAhF+ns2J+z/qrRktN0Yjfhra+xQWqM33dCt Y9H14ISeMTzVmthcIkO8KcaVVpNcv8ZOKtU/xlL3ulF4VWZSeK1dRgbT3Tkx+/2/oDUl TSKNInmlTp+K17EKG9JehsMUHWae4UuS8400pRVcBfBK6WGkTmTQKLC6vgUfa9pUI6vl dAcMMvoMLHJ2TfMDjQqytlex+1m7ZO8m8XyQOLcHrk2ABiBbFdDTlWEKATNId9UmVnAu W5WA== X-Forwarded-Encrypted: i=1; AJvYcCXRefa5prTUsiLvw+raukzc7PZyu0R3popukLRmYmgWhtkJBvFXMid0mR5yM1/fG5ySBm2mJuN4VRnKzEUd@postgresql.org X-Gm-Message-State: AOJu0Yy45o86I1L75MAPZQJdO3zsJhrnzBX7Oy7g4Qr6ZEoeEQzhWycK tC03s+ShNLAErmfiQJAAUd17zUa9k4z76x5HHwlyoId5KZjOBBNNRFICGxsK61djvftTdFka2hC 2jbLkweH6tIJEVI79NjEbVdJ2P8k= X-Gm-Gg: ASbGncvAykxaoiK8lRkKU/JF9s7SFNEthHJOiAqTCkF8SrNYP/kayON0mDLPl8ULM2m FPBRs8K9tz1UQl/9hm7jCocL7CsA2pY9o+z4dKqGqgMr62HzkUp44IG7BJDWGPJvcN1uI+WAsug K7vTXo/2IP X-Google-Smtp-Source: AGHT+IEsOkmylK4St+F7acie2BytpM4wrHitY5EwXR67IvxFx+yuAIzQrl1UbfXBEDaFOhrmtyJaX8f+vWKy1V0pJhQ= X-Received: by 2002:a17:902:db0f:b0:21f:52e:939e with SMTP id d9443c01a7336-221a10deb2amr24056475ad.28.1740109226203; Thu, 20 Feb 2025 19:40:26 -0800 (PST) MIME-Version: 1.0 References: <54c35fb9-da3a-4754-ab8c-46ed0b612465@vondra.me> <684c70d7-180e-461d-9377-600c2db581ba@vondra.me> In-Reply-To: From: Amit Langote Date: Fri, 21 Feb 2025 12:40:09 +0900 X-Gm-Features: AWEUYZlUA5UY4rYr-98_v0LixfbMiIoXawV095nHDou6G8snttXoQvWuXxMBbzM Message-ID: Subject: Re: generic plans and "initial" pruning To: Tomas Vondra Cc: Robert Haas , Alvaro Herrera , Andres Freund , Daniel Gustafsson , David Rowley , PostgreSQL Hackers , Thom Brown , Tom Lane 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 Wed, Feb 12, 2025 at 8:53=E2=80=AFPM Amit Langote wrote: > On Thu, Feb 6, 2025 at 11:35=E2=80=AFAM Amit Langote wrote: > > Per cfbot-ci, the new test case output in 0002 needed to be updated. > > > > I plan to push 0001 tomorrow, barring any objections. > > I pushed that last Friday. With bb3ec16e, d47cbf47, and cbc12791 now in: > > * Pruning information is now stored separately from parent plan nodes > in PlannedStmt. > > * Initial runtime pruning occurs as a separate step, independent of > and before plan initialization in InitPlan(). > > * The RT indexes of unprunable relations and those of partitions that > survive initial pruning are stored in a global bitmapset in EState, > allowing us to avoid work that was previously done for pruned > partitions. This was difficult before because initial pruning wasn=E2=80= =99t > performed before the parent plan node was initialized, meaning that > the work we aimed to save had already been done. > > The final remaining piece is to skip taking locks on partitions pruned > during initial pruning, and the attached patch addresses that. > > I=E2=80=99d like to commit the patch next week, barring objections. I pushed the final piece yesterday. Thank you all who have commented on this thread, reviewed the patches in its various incarnations, and offered advice here or offlist. --=20 Thanks, Amit Langote