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 1w0pjd-002FN5-04 for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Mar 2026 23:46:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0pjb-000t3N-0t for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Mar 2026 23:46:31 +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 1w0pja-000t3E-33 for pgsql-hackers@lists.postgresql.org; Thu, 12 Mar 2026 23:46:31 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w0pjY-00000002NQS-3orx for pgsql-hackers@lists.postgresql.org; Thu, 12 Mar 2026 23:46:31 +0000 Received: by mail-pf1-x441.google.com with SMTP id d2e1a72fcca58-8296dabef74so1527681b3a.1 for ; Thu, 12 Mar 2026 16:46:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773359186; cv=none; d=google.com; s=arc-20240605; b=lghl4fFev7t930MUpMSJMvHL8xmY9vAbseeY1UwN/xZXptSfI4wzb7IcrgwgJ/ROgp SQvm/hNYqFwW73xWA8n98paA21wHDrYZAYvjTSoDSxRxBtZr+ggB1d65y0y9b+aufsFb Ut+D4LBxdULKvER4468Gw6lYBRG7HldPDDZYBLGuGw/e2Pqq8uJq4ivmC8zbjkZGQhut 1+Z/kbRDDbLxWhTYp76DSAPqLUgKtsLdp42AAQbI/T9kGAwZ4ddbR0Se91p1ODh+LRGO CgxF/nbB0fKyZDWiYiQ+cyVc84qFEQ/ggnluu7TGxkXumU+hQXyXxN6Om9//yCD5QE7b xx7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=S4+ZS25o8+6NeGkx+KiKsUUKcfgVMEfvAlrxaoZxwsg=; fh=1wKJLloDKJSmw3wsOUs/rIGGbFAm7iO5LWdv8x1DK1A=; b=B6pr/UZ7/MSZrBm1rAi3FoP/7f66EqJ3RV19p1O96Jlo64eAflolBiGJIR0eJAAkVC YPRTEtiaD8f25owWN09bWrk08hIvB/p5vHbdb/A2yibdSfkioqCU47Tww4dKhD7WJwYv bqyUvtO59z5Rs0RQqUgXFWtjUZyZNRSULLIQw2m3op6H30UtoiDFaW9i33AMUcVS+P9q 0m99X73mW9KZjwSjyva2QjtPLY/JGRF5r9UaZBSEm7xh9mm+QCB6G3nXs9a5DycClwTY yEEdLbvZe0FZKh+164MJew3TYqeb7EDxgMkVOpaeziljQ9c+qtA+QRKLtaxzb4lQDMJd gerg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773359186; x=1773963986; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=S4+ZS25o8+6NeGkx+KiKsUUKcfgVMEfvAlrxaoZxwsg=; b=hEUH6qnmcVtVbUsT5z3h3kBKh1NrxSgiUnlkEhyNIG5wDbAjuaBmoWU2h83pJZ+vTb J5KtunBkXKmGFIzEKND4kz/EqqWiL0tO+QHIVc3CKmzJlty+fksatcrscLfJcB6k7skw XrRjdmXdnsKwhPRDNIoM2y5pyzpTzJSYpvmLAitDUImWqOXP3Ui7F/ilH2TQauSdYJ8f PvwTXzcNarxaBV8jg/2xWKrjETkvaI3ZcfhUNEnITBqX5PYoW85vnMHRS0bYpBnXsfRW IKoyV8iZcd7TWVwnpqa3+z3/sOQmTTWWamtD94LnWlcuDFX7DEi/ZOdJdeN/OHWoDr9S Ywvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773359186; x=1773963986; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=S4+ZS25o8+6NeGkx+KiKsUUKcfgVMEfvAlrxaoZxwsg=; b=VXM/HzkOAPx1+0T8v33i06Ws7ZYpgG9+TfUgufwBJfYh8c93WR2OY2jENrStQXsbTq DNx35+wChAzzFp/jWIpPFFhzMJafQU+moG6HbmFbcLFv8T6ls/3+dOkRFU3K1IASB63t GrgUzUjEBPJVifB/PurSq9JCv+sv/dusa7f8SQzPA9AEDtq5QniSd66AaWgcYOU/fddc jxv9thp6HBwhfXqErsva8c2eysD44qzHniBjEDbHGMqaOIAioJrf28Un68aRN2ec2vWP JOuewedH/kY/vSjGjin4lksz1m9VXAfbAZMczcOlzfUuqsXyGwYyIgMYFrkUosh+n5gb A8cg== X-Forwarded-Encrypted: i=1; AJvYcCUFScIot6j44mTU33GHIOgR1Vu52rOAUgn912gpa+3RhJlIqAfFYMja25ehQqI51pqb9SB4tvKgf0S4LW5f@lists.postgresql.org X-Gm-Message-State: AOJu0Yzg5yvlgX7a4E6iphsIdA42UN51ucq1y4/PgCxTafvSpBD/iNwW 1F3dRwa6buBr8ooZcctLoddm1xqGnFwOswL5VLT8ZpOdVWiuFKPUZ6idlDnG7uf51VHs63S3H8E rWfbHv1lfITOmNTm7MpV8+rvfzfU8iyE= X-Gm-Gg: ATEYQzz6TDkvknBSydZttTjsCcydfbbKPLT7EEHCQRKHiiJU/bc65igFMAYsRMbIWwZ OMqN+9P07PN+t5ayNnRJizdS9X87S6wETb7dq/ZmBZ6a/rRm11/vhQp2CYJJU8bszPraav1pLI8 PaSHZRyZ9tD/hL03ltoHTfopjIbhi4CuXxAhAhYyuwunrz5NnmMhswrDwelKlorzWhQO+7j2snG uV7TZczJLUw0F47/0XMZ9CCgnIIGyPNsPlDFd7Xq8BjG+QPX64WC9OI6QzLyyTUsVI13gocrqWt C3Edmu7s2g== X-Received: by 2002:a05:6a00:1a93:b0:829:793f:da6c with SMTP id d2e1a72fcca58-82a19899de0mr988985b3a.39.1773359185835; Thu, 12 Mar 2026 16:46:25 -0700 (PDT) MIME-Version: 1.0 References: <1136161.1769654478@sss.pgh.pa.us> In-Reply-To: From: Alexandra Wang Date: Thu, 12 Mar 2026 16:45:49 -0700 X-Gm-Features: AaiRm51FoQE9CxFszmFi5ggoizbBQqQvSd5jnbEVM6MFkz9JgY6e37ppeYGy2uM Message-ID: Subject: Re: pg_plan_advice To: Robert Haas Cc: "David G. Johnston" , PostgreSQL Hackers Content-Type: multipart/alternative; boundary="00000000000054bb30064cdc5c4e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000054bb30064cdc5c4e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Robert, On Thu, Mar 12, 2026 at 10:16=E2=80=AFAM Robert Haas wrote: > I'm still hoping to get some more feedback on the remaining patches, > which are much smaller and conceptually simpler. While there is no > time to redesign them at this point in the release cycle, there is > still the opportunity to fix bugs, or decide that they're too > half-baked to ship. So here is v20 with just those patches. Of course, > post-commit review of the main patch is also very welcome. Thanks for the patches! I've run the meson tests for all three modules, and they all pass on my laptop. For the make tests, I had to add +EXTRA_INSTALL =3D contrib/pg_plan_advice in contrib/pg_collect_advice/Makefile in order for "make check" for that module to run. I don't really have a sense of how others feel about including these modules, so I can't speak to that. Personally, though, I very much like the test_plan_advice module because it gives me peace of mind, and I feel it should accompany the already committed pg_plan_advice module. I reviewed the code and have a few minor comments: 0001: The "make check" issue mentioned above. 0002: Looks good to me. 0003: There is a typo in the commit message: "pg_stash.advice_stash" should be "pg_stash_advice.stash_name". > stash->pgsa_stash_id =3D pgsa_state->next_stash_id++; I doubt there will be more than 2 billion stashes in the system, but if in any case we reach that number, we don't handle int overflow. Should we set a limit on how many stashes can be stored? Nit: find_defelem_by_defname() is defined in all three modules, and also in pg_plan_advice. Knowing it is very small, would it make sense to extern the one in pg_plan_advice and reuse it? Best, Alex --=20 Alexandra Wang EDB: https://www.enterprisedb.com --00000000000054bb30064cdc5c4e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi=C2=A0Robert,

On Thu, Mar 12, 2026 at 10:16= =E2=80=AFAM Robert Haas <robert= mhaas@gmail.com> wrote:
> I'm still hoping to get some mor= e feedback on the remaining patches,
> which are much smaller and con= ceptually simpler. While there is no
> time to redesign them at this = point in the release cycle, there is
> still the opportunity to fix b= ugs, or decide that they're too
> half-baked to ship. So here is = v20 with just those patches. Of course,
> post-commit review of the m= ain patch is also very welcome.

Thanks for the patches!

I'= ;ve run the meson tests for all three modules, and they all pass on
my l= aptop.=C2=A0

For the make tests, I had to add=C2=A0

+EXTRA_IN= STALL =3D contrib/pg_plan_advice

in contrib/pg_collect_advice/Makefi= le in order for "make check" for
that module to run.

I = don't really have a sense of how others feel about including these
m= odules, so I can't speak to that. Personally, though, I very much
li= ke the test_plan_advice module because it gives me peace of mind,
and I = feel it should accompany=C2=A0the already committed pg_plan_advice
modul= e.

I reviewed=C2=A0the=C2=A0code and have a few minor comments:=C2= =A0

0001:
The "make check" issue mentioned above.
0002:
Looks good to me.

0003:
There is a typo in the commit = message:
"pg_stash.advice_stash" should be "pg_stash_advi= ce.stash_name".

> stash->pgsa_stash_id =3D pgsa_state->= ;next_stash_id++;

I doubt there will be more than 2 billion stashes = in the system, but
if in any case we reach that number, we don't han= dle int overflow.
Should we set a limit on how many stashes can be store= d?

Nit:
find_defelem_by_defname() is defined in all three modules= , and also in
pg_plan_advice. Knowing it is very small, would it make se= nse to
extern the one in pg_plan_advice and reuse it?

Best,
=
Alex

--=
Alexandra Wang
--00000000000054bb30064cdc5c4e--