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.96) (envelope-from ) id 1vNNHn-000vJ8-0M for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Nov 2025 03:30:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vNNHl-00GIi9-2P for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Nov 2025 03:30:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vNNHl-00GIi1-1N for pgsql-hackers@lists.postgresql.org; Mon, 24 Nov 2025 03:30:41 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vNNHj-0019jO-0V for pgsql-hackers@postgresql.org; Mon, 24 Nov 2025 03:30:41 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-2956d816c10so44454455ad.1 for ; Sun, 23 Nov 2025 19:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763955036; x=1764559836; darn=postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nVrKj/rgmyfSEK7OybtpVIxX6XdC6Iha+f4e4oW3L2s=; b=hi8Stv3RdK1rFLMCA98FMSXL5Mq5gI+UcLeTSM9o3C2tCE0jrUT2cP6qULOfCHoqr8 hyR45pp/VL+9BJGCYFs6UyTL+aYaQIZ/i2jonjbDXmXVrDmWA4NqM2GNXHrkXcu1MOf6 +MIUan7UxYFbTpsOCVqPJfYYg78HmpEwh9JbJ8fSLqN2DM4266iqVvcVuPbgUqGqHo9K LU03FdFZJ1+yy/wFQcIkQvld5RpqtAA+IxFsVpwjW19ztujkui0ymt9y10x5+m88aWev TO683S+yg/56TJNu8vtCCOKXqZ9qlrU8zsD9ZLMAv/M+SwY9PGH6F+Yk+QJ1xme/pRQq KNQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763955036; x=1764559836; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nVrKj/rgmyfSEK7OybtpVIxX6XdC6Iha+f4e4oW3L2s=; b=qjsllJRNhTlp8lDizvHEagr+ZcPrMAAD5cVMmGFG+P7+qrNw6S6BhmklH5oAOFiNh8 E+AsRtKRbQaInygChCIbYC0SRa7Es9txWgbpVjQjyRh63AwJFO3eoFj7Cm3dISTvg+gR dqAkxqW4f3OfRUcYZPkbYzoaBxz0Gl/23LEetFA+G2tQ+WLY5Edao0xr9aKyNnmFDYIW 8IP9mcuEhOihVT8TQbD4I7mCt4AKxp4nhHkHJvGyeVBjLcU4zGdjJtmx76PjUzkIz/lo x6nKMLOqapxgEyOQSEFoK1vWJu27RGb8adelqXhK/kPFTTccdMoe1bDD4GV+GypXaPzh B67g== X-Forwarded-Encrypted: i=1; AJvYcCXt86LlP9GRfG8Vf9dzsk84rABFzRldwhexAzx7gSvVUasjJ+yTqTZTZE8v5v+Q75AosEyYB5FyZ3nExnNT@postgresql.org X-Gm-Message-State: AOJu0YwySCnau+pG7E7TmGFHyacajiaAp9pn4izRuLyddIqI+QbuZEzk TsVgSwC0ElMODhVMlACbAgOTXUsRUjfRU8kQXpx+Q57DU0hLnvCFKm6g X-Gm-Gg: ASbGncsFA68eKyRaKFsmli/7zPKihkFhJEH8OhWJ5DcY1D969zkOt8BdMrHcAH37nX1 /Mzf3jDzug/czWe8420B6myX+2qZoNyLXnrQcpnXKHpbO0HMdjyqjJLjCR9KYDBwy8aiZHFI2XW h5tzuN04o/ke+XbrW83r0FgLpzJJ9lf1D2ao7vO9PtJfC/xcskWeBeeCjgxzz8AvHsU9KnfChUN y2y0Ceq9nKhIKQTQaAQgCugASpW0UJ1Zfboz7bdRN6cosEmXBdTS8ksFdwNvqoHJkda4mQlw4kV KL6sy+eLYYSYUwDV9JsLUh7Rfkfx/tU+wnDGg5sydbLXIVR50kvxH30JGAtJbY/OJy1hFVEwDuK tcQaRv/o356Gz7lut6o3i2EYUpevau496o3nL2MMW9Er3Ft9cLZ5kBDHjJ2uoyrLDAQTZlJqWgt abC39oxcsjzhSHz8Ti/F0= X-Google-Smtp-Source: AGHT+IGhtwGXKQYccXI/Z4qOr9S9+zfZXiL0EpgtGDlXqQpei+shqf+RlFOxBk4k5HeEfjxnBhp9jQ== X-Received: by 2002:a17:903:3ba5:b0:298:43f4:cc51 with SMTP id d9443c01a7336-29b6bf9b214mr99155395ad.60.1763955035612; Sun, 23 Nov 2025 19:30:35 -0800 (PST) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-29b5b111adasm119943055ad.18.2025.11.23.19.30.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Nov 2025 19:30:35 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: generic plans and "initial" pruning From: Chao Li In-Reply-To: Date: Mon, 24 Nov 2025 11:29:53 +0800 Cc: Tom Lane , Tender Wang , Alexander Lakhin , Tomas Vondra , Robert Haas , Alvaro Herrera , Andres Freund , Daniel Gustafsson , David Rowley , PostgreSQL Hackers , Thom Brown Content-Transfer-Encoding: quoted-printable Message-Id: 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> To: Amit Langote X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Amit, Locking only surviving partitions sounds a good optimization. I started = to review this patch, but I cannot finish reviewing in one day. I will = post my comments as long as I finished some commits. > On Nov 20, 2025, at 15:30, Amit Langote = wrote: >=20 > = 0001 splits creations of es_part_prune_states into a new function = ExecCreatePartitionPruneStates(). With that, you are trying to make the = code clearer as you stated in the commit comment. However, the new = function is not called, meaning 0001 is not self-contained, feels = unusual to me according to the patches I have reviewed so far. I would = suggest have ExecDoInitialPruning() call = ExecCreatePartitionPruneStates() when es_part_prune_states is still = NIL., so that current logic is unchanged, and 0001 can be pushed = independently. 0002 moves check permission etc logic from InitPlan() to the new = function ExecutorPrep(). The commit message says =E2=80=9Cexecutor setup = logic unchanged=E2=80=9D. Because in old code, before permission check, = there was no PushActiveSnapshot(), but in the patch, before check = permission, PushActiveSnapshot() is done, which may introduce different = behavior, I just wonder why PushActiveSnapshot() is added? Actually, I am still trying to understand 0002-0004, it would take me = some time to fully understand the patch. I=E2=80=99d raise the above = comments first. I will continue reviewing this patch tomorrow. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/