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 1w2zTS-000nJB-2Q for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 22:34:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2zTR-00Ex6v-25 for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Mar 2026 22:34:45 +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.96) (envelope-from ) id 1w2zTR-00Ex6n-1B for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 22:34:45 +0000 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2zTO-00000000RBJ-0qMx for pgsql-hackers@lists.postgresql.org; Wed, 18 Mar 2026 22:34:44 +0000 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-b976e181895so53014866b.1 for ; Wed, 18 Mar 2026 15:34:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773873282; cv=none; d=google.com; s=arc-20240605; b=beQVOkLwVuRRC7dp+xudLoWzuOrNQvQbviaqZnvKi6CKQz9AJIhRn5zG4mSeiZZn/u h1wyxIEeePkdN7ihnJAbhYZQ3evyOZ5vtjYo7UHmGlqxIOOfFIXzeqgFd0mR1aOngaxV GSKze9y4whqtL3Nx6UPYV3Cj6A7ZG1iBQ5gkeN+M2gmle7Eja/Dg6gWR8ef3Q3Ainnry puXgn3O/CAQudNccXJz95Hv5QXkcrEVhzAwzPSy+/0XTyOfEGQh7BcsTohpOmkTu3sWc GKxp3ilw+Hhb3CehGYqfGJwrif0dYshGFVX1bTRNdlIWIrmLpacn04pCmeplpi03bOBx O8pw== 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=cXaHSeDgJ+0h/oHYuQgO1Z/RJqtH7QmJZXmX6tQ57Us=; fh=YhmxPC0NYagsxVMppzYMgO0XMWsRSWzMegLjmIklu8U=; b=k7KltM5HJzL/inNRQs8u84oB4PVbgeg8KxzWc3kISxvmX37hSBnePvHbBAuyZGaX2s JrzsuxOGp/Znm4rTXDzzRqab7xEXI01U0FYLVYJZA6WERkkD16vzp9SnDQq8btXZXof4 KCygoeJcDpJS8bxjmnd+HMtSsR33Fen0ayaAB3ySrUugJXJ3VTAuy6rs6mHOSCpFjuFJ gG9bwqJs2LoBA2etQmpJEpR87D0fsabHYybllluG+Jz36SBsxlFxX+AgYJi3XyOMubYt 9SqCEzdjOAxylf74cpVUKSsk3H3MshMNptiwYqNtEJBsMcAz61vyRedru6/Ry703XcE9 33vA==; 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=1773873282; x=1774478082; 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=cXaHSeDgJ+0h/oHYuQgO1Z/RJqtH7QmJZXmX6tQ57Us=; b=Bvxk2SdJNmKLS1bHU6+aT6m31a/kZuztIIVKtLc0YaVy+XBUneRMWmccahU190QwcH kVe6dMt65qKSLN9KcmjheC11/jYBz7WQva1fxsyzWxDLWkN1jW9jrCmQ0Lc925lQQH9p kraAT6Pcny72BvhpD3UjtBmYWsJzk8D/YW6DdFHE6JP49Y3ltX/Y/eW/E/0HHR7Myl60 OvvdgxZ772/4O3ieoF6qXWuRus2SZoXj9Ep7jFWqTV/6nyA1JkwacieGVX2KnrDdnp8a pC+oJeVuAaOb/yGuWHvi7jOJ30nEzMy7buDHgwxcieYPQ39TEKs/It6LzKl8m9KSAv18 kLvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773873282; x=1774478082; 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=cXaHSeDgJ+0h/oHYuQgO1Z/RJqtH7QmJZXmX6tQ57Us=; b=L6Zt774tZagz3QtAC3RIMQrDP/9Fx27wYhXoVXYOvLr36J5D155+6lw9dq3jO3Rmk9 BJvGsA1vrGhCx411N7qcY25BO46BY5TxBJA+mlx357Wv/ramF2/tGUSgYWv9gukIPHgL a2S9I/+RK4sp9pVKF9RHFUFgngUF3UZmCT1fSlNnRVicIvMvn3ZgoxW6MSakv1dTgk3f v0ZJM+t3qv9aqHMSaNvEpNMJleRVPlv5KBrdwbLpalrfbba5j24S8vsW4nVJl9mHrXRg jXkuxHWUKeGUMIZ+bqmqAvo1AocNPxdKTjbBL13hZxoJLLVXboc18tP0XIcKbc14lBFJ qk5g== X-Gm-Message-State: AOJu0YzUQDofI98SxjJaaqx3dHnB8c0qub1BLQ0nUTs85Fmx45saDWAW /bnEAh4R1L4d3GKe7UuGvaYv+1uKITZB44NHUWTa6B9RuKlsoiZL/DCRojp4PBWCZK2OpejdJHL TupJ2uuBT5FTTsHwDKE3vwiUbLID7t/Q= X-Gm-Gg: ATEYQzwSFKfgsKivoXZbv/jVkoVkrHxK4U6ejvIZeSwdGGqiVtpFOvUyXAbkVeWY/n/ XFTqyP67P3qibotFyD6Ck5d/wUQXDVCDOQ7+vAZZmJfRLeA5q3YGbseeTsSN9+wpaSL5Uo01MlN iWgNo/CvBeH8DHp9XqVAVJkhVoQSA9ZXfn0303sBQ0eM9W1kMD6NEde/qSUcT768IZxWkBeCTFa yMk6R3VPLGvqrbpzfF9EL6KCEFBLs3uFUljZuShEUQQEzFNwuaBddh5ClgZpDxF2GW4Lg8mV3HO sgJQCLcM5banFSpMhAhnBB31zluZMbxMLJkLYtY= X-Received: by 2002:a17:907:9348:b0:b97:b2dc:91d7 with SMTP id a640c23a62f3a-b97f480e6e1mr328459266b.16.1773873281979; Wed, 18 Mar 2026 15:34:41 -0700 (PDT) MIME-Version: 1.0 References: <1136161.1769654478@sss.pgh.pa.us> <1057602.1773866674@sss.pgh.pa.us> <1072503.1773872802@sss.pgh.pa.us> In-Reply-To: <1072503.1773872802@sss.pgh.pa.us> From: Robert Haas Date: Wed, 18 Mar 2026 18:34:29 -0400 X-Gm-Features: AaiRm51VgEy-jWF_xLgOGpNd8FrqNzze8N5SzcPMK1r5DhvEs1YZ_33FNL_NYHc Message-ID: Subject: Re: pg_plan_advice To: Tom Lane Cc: 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 Wed, Mar 18, 2026 at 6:26=E2=80=AFPM Tom Lane wrote: > > Well, that's embarrassing: it's a copy-and-paste error. The test > > prepares and executes pt1, then prepares and executes pt2, then > > prepares pt3 and executes pt1, then prepares pt4 and execute p2. pt3 > > and pt4 are never used for anything. Also there's a related typo in a > > comment. See attached. > > Ah ... so the observed behavior is because if pt2 does get replanned, > that happens with a different always_store_advice_details setting > than it used originally? Close, but not quite. always_store_advice_details is set for the even-numbered tests, so it's the same for pt2 and pt4. But pg_plan_advice.advice is empty for the the first half of the file and set for the second half of the file, so it's empty when pt2 is prepared and contains SEQ_SCAN(ptab) when pt4 is prepared. That accounts for the difference. avocet is actually doing the right thing, and the rest of the buildfarm is doing the wrong thing for lack of replanning. --=20 Robert Haas EDB: http://www.enterprisedb.com