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 1w2Bqa-0004Ou-09 for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 17:35:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2BqY-00BbPg-0C for pgsql-hackers@arkaria.postgresql.org; Mon, 16 Mar 2026 17:35:18 +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 1w2BqX-00BbPY-2M for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 17:35:18 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2BqS-00000000Shx-1AD5 for pgsql-hackers@lists.postgresql.org; Mon, 16 Mar 2026 17:35:18 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-b97a06d7629so283985366b.0 for ; Mon, 16 Mar 2026 10:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773682511; cv=none; d=google.com; s=arc-20240605; b=Xlkwd0jJEeFO10szq4PSsSjIku08QxjW3JyqZL8/dqSI7jTBS4O5XuKoiN7n0vrT1n VmR5/cFuW9+9NGv6He0FbFPQEkAHBz3nlj92bCp70cD82IuYiRO2S9YYY54OZYTp27LS ovsGr+h70nCnKMMrkyQjS7FhsAeacz/qZHE0ZX00SM3wUsTsAxDsrmsEwoUYtq5K9x5b 09Meb0wIToTveM1bmxhmCv+/vbZ0dIvRMNf8PwBhVV3+klk+0FE82SiMxF3emUoA6mxJ DKq5DHd7V2Chn0Bdnm7Bqfn17XlBRHncKKnxQCP2pqvenAULJtYlusz9CqAkhRj9FkkD 7tAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zvBih8hpfMqaiNdBNYIoFTKPxQvrJV9n9jnJT+tTi2Y=; fh=xRItBoQxq8uKbJi1akaTHkz4zgkX9yl6J9GxD5PNoM0=; b=YzsUX9ZHe1PwKbfId/esmh8lYq93GT2M66ux4XtNwhKImyhzLIGT39U0UOYDbtXjG7 hp6Z4rJ9vevFP7aCUUaLyyyhywwKzFyWnoVdyMVtGjoiJiySqUv0PAz1nGm/J7bLqW3q y1uUKBuY52xaESTZCyJiVY7RgKpqWv3tEpKlRPtI8Y3c+Zzkx0wUudUJAVynPkdo/1Vx H6+RrXvCoQwIyyLt0NDf883lBnIvytzNk6dQN63tWL7zBbjIIxjUCJleSkXVtX/11qaA BkwKQKCVhyPZvovqwMREZV2DnqI1y3lZBxkNNZdfqPbf6UJIhonDvOjDtNHdA5GdBD0b O1sw==; 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=1773682511; x=1774287311; darn=lists.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=zvBih8hpfMqaiNdBNYIoFTKPxQvrJV9n9jnJT+tTi2Y=; b=JwWNCp9ZK66mP+E7tQSN61YN/a6Ti+oYVQ7SoYfo2oXnWpaqFshxLS1QntX70PgBr1 vdoGwenupnmmWcOOvYQ1Hrqnc9WeXKsk51tyGA0a2uBcF41Lgw0CPTgEu9al6eV+ZNP4 x4hvsibO6yBVaUp2Iof+4GBZXwkF/x6XVmuTYIZ4tBIKZshaq2mX3g38X2588P0V6XGT sB+3dD4hUZXpJzDFtJLEP9mG8fMaNpoP7HxlFSenlDZ1prIqXw58F7JeqmrXqPeD87Xq zBKY60QM/5UHGA+d6xWP++fokLf3kibbmukHNx/Woe1wKXEcDJ0qufaq3YTdDIKm1889 B0lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773682511; x=1774287311; h=content-transfer-encoding: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=zvBih8hpfMqaiNdBNYIoFTKPxQvrJV9n9jnJT+tTi2Y=; b=m9rTCktpvvFiWCn25Cv3uW1C48ZS8xBrlLo29lcmCYFDD6pXgWfKEzKG7NqFc8tgw+ B66Ig3AAspW4ym0llj9OjW6q9Yja0pa0qMa0jJarQtO+BECZxsoHGTGUTUUFXYZ8dO+q IwigZQyzUoaWABgbeP4xTC8JiVniyuPO79AzbkJlB9AGOzSk5tA12pIbzp3CiFzqQSDP HxuENcBUAlyXoOYsfinzJck2HOaGCpM9I3o9zm2F2rJ1r8jRqlaZtsRCyxPBjJKIFUQg nIz+TPtia3IhJwsS4kEi9kVWj6FC9cGAH0CkCLVQ8cwG2StpvCm6aktmqjs7IU5+oTv/ QXZw== X-Forwarded-Encrypted: i=1; AJvYcCXmcCh8J72qWMCG1CWji2njQn9RpBlaaEraCc1ZvbHKF/7Ln08fo+w61T780Mz6wcoTurgZPcDMFeMn14B/@lists.postgresql.org X-Gm-Message-State: AOJu0YxMgKRpPUtQCzqe9OIfOod60pzizUHHBDOj+/wUDGhrEA4Ou+mv CLHH5/Iz7b5vFZWgwQIQiBIZl5w6CT59VdG/xkf2LWnuoXoJ+7SPzQ4dCvP8CW2Ds3ry3fIjSxS 0iOQXAj747eHfkTPQRm3TPwNDYGZNENI= X-Gm-Gg: ATEYQzzzOC5AaTrDsUpXoA2jVQx7GnlJwNLBLo9mksgPXR1dYYZX/Qmn4g+ng0hhIvM hql0BOWUipsJ8kq1VAfSQmvaHFG1sfbbXI6Rxd+guOfDbgiFSVzTiJrHqMFOzl1vRIyk96RfKao g4EY9sKA559ZEhlri7k0YNjLqTD7grpp8yAZpmtQZ48sSOrcBDe45EhhfebFVCJKeR6EmPy6V/f KjXV9Josp4JTYsJ5Xe6NMQV8+a+Sj6A3/x8SC1rZUfoMt4HM8ld3ftMnP7S4qOH7CueJRW4SuK7 rQwqRfoxgA2iyUK7KWCzfeiRHjwGUjDhs/gts/k= X-Received: by 2002:a17:907:d1b:b0:b97:d465:fac4 with SMTP id a640c23a62f3a-b97d465fcf2mr68375666b.13.1773682511222; Mon, 16 Mar 2026 10:35:11 -0700 (PDT) MIME-Version: 1.0 References: <1136161.1769654478@sss.pgh.pa.us> In-Reply-To: From: Robert Haas Date: Mon, 16 Mar 2026 13:34:59 -0400 X-Gm-Features: AaiRm53mBtUVU-bIZrF5zIzvXsAA1m-fCt5ly_n6GxbEje5AbCFK-IzGhsgu220 Message-ID: Subject: Re: pg_plan_advice To: Alexandra Wang Cc: "David G. Johnston" , PostgreSQL Hackers 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 Thu, Mar 12, 2026 at 7:46=E2=80=AFPM Alexandra Wang wrote: > For the make tests, I had to add > > +EXTRA_INSTALL =3D contrib/pg_plan_advice Thanks, will fix. > There is a typo in the commit message: > "pg_stash.advice_stash" should be "pg_stash_advice.stash_name". Thanks, will fix. > 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? I think the thing to do here is just change the stash ID to a 64-bit value. I'll do that in the next version. We assume in numerous places that a 64-bit integer never overflows (e.g. LSNs) which is pretty fair considering how long it would take for that to happen. > 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? I think if we want to avoid duplicating this function, we should actually put it someplace in core, e.g. expose it via defrem.h and put the code in commands/define.c. Any user of extendplan.h is likely to need a function like this, but we shouldn't put it there because there could be other use cases as well. --=20 Robert Haas EDB: http://www.enterprisedb.com