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 1tcRTM-0007lX-Uv for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jan 2025 15:56:25 +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 1tcRTL-00DLJe-M1 for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Jan 2025 15:56:23 +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 1tcRTL-00DLJV-CD for pgsql-hackers@lists.postgresql.org; Mon, 27 Jan 2025 15:56:23 +0000 Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tcRTJ-001msg-0u for pgsql-hackers@lists.postgresql.org; Mon, 27 Jan 2025 15:56:22 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.stl.internal (Postfix) with ESMTP id 1528711400D8; Mon, 27 Jan 2025 10:56:21 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Mon, 27 Jan 2025 10:56:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm2; t=1737993380; x=1738079780; bh=0rlS6CkZOSPSwHF1ia7f0C4hWV473Ep7 iInAbutSIV0=; b=a6Q7mTKx56TaazF4/1lhokVcI7h9oruXzYYRL+BXR8s8O4VM 6uGTjI42/rO6KMVt7PB9mEo+5oWIKlyyhPPzSo7IZmhmr1n4rZ2PowewnA33yfOu urTJ+WZxGft/IsMYqnF35pnqzfb6+k6oyb2OK4CW1x1P2rWWsXqOvdtHtz+ypH7d F0UIqONfIDUiCzUhn9yDV4CmCZZbKmBfBTaMRre8iBG5MLmcNEl2VHAjdnprJVss 0PoIsdpaDNbVYrlBPr2BOTPKCln/f6C3uYdQmLJ1LQNOBjceWqP2VRbukcn48Gt5 FB40hFH7spKrliog039y0JHznl5M0Id6OjIIxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1737993380; x= 1738079780; bh=0rlS6CkZOSPSwHF1ia7f0C4hWV473Ep7iInAbutSIV0=; b=l kHq05G4+M4iYFc0M5hvus3AMYh5e8ltRb1Mso66gk8Svpn+LMcP+lJpBJ6NvcPy4 HZTYrOgAw1c8eez6sca455brh+dt9aL57hsLXp9GlHfQCwX8idYRTnvlcDwsd4L6 77HJP3zvihuQSysBFVsmyC0II+vv6U11IhdPEI4HZaAfneQk1PH1PIAyiGRlurf5 8ZyE+H43bTZC1T4ctswgX4QXNY6MSNq6PIX1nMYLTecxiTCbta7/dPDGbfzItq3I kP/WI1WarM2cQcxyCTgGoqJOREJxdTm79OLraE0wZ3w4FKK62ZT68gtGoNXV5SM4 a1szy38igCTqSYyr8ieKA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudejgedgudefheelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddt vdejnecuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvih hsvghnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepgfejtdfhkeeftdeugfei leehteeljeeghfeuledthfeutedvffdukeefjefhgeehnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhht rdhorhhgpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtth hopehpjhesihhllhhumhhinhgrthgvuggtohhmphhuthhinhhgrdgtohhmpdhrtghpthht ohepthhglhesshhsshdrphhghhdrphgrrdhushdprhgtphhtthhopehjihgrnhdruhhnih hvvghrshgrlhhithihsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqhhgr tghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepvh highhnvghshhdvudesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Jan 2025 10:56:19 -0500 (EST) Message-ID: <23923ad9-a468-4c2e-8926-e47d15d1eb23@eisentraut.org> Date: Mon, 27 Jan 2025 16:56:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: SQL:2011 application time To: Paul Jungwirth Cc: Tom Lane , jian he , PostgreSQL Hackers , vignesh C References: <6dc196d4-8853-49d7-8dd3-e391058451c1@eisentraut.org> <66e47fc0-77b7-4763-9b70-5c0b7ff15f21@eisentraut.org> <333d3886-b737-45c3-93f4-594c96bb405d@eisentraut.org> <6a2247d9-461d-4b0a-b692-f0f3c0fab27f@eisentraut.org> <8f995a4c-64e3-40cd-bfed-06b54a280d36@illuminatedcomputing.com> <0832f18d-523f-4c15-acb0-338a785150c5@illuminatedcomputing.com> <5f0c25de-2c13-4fb5-a4df-a1e03c43cd14@illuminatedcomputin! g.com> <1b45f81d-4e99-4813-a2c6-72bf5fd80980@eisentraut.org> <3611540.1737518430@sss.pgh.pa.us> <9bb3eea7-820f-4932-92cb-cb564fc44caf@eisentraut.org> Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 24.01.25 00:20, Paul Jungwirth wrote: > What about caching the FK's query plan? Could the RESTRICT test ever > reuse the constraint oid from the NO ACTION tests just above it? I'm > pretty sure that's not supposed to happen, but if it used a plan > generated from the NO ACTION SQL, it would exhibit the behavior we're > seeing. It also makes sense why it only appeared after 1772d554b0. I think this call in ri_restrict() ri_BuildQueryKey(&qkey, riinfo, RI_PLAN_RESTRICT); needs to use a different third argument for NO ACTION vs. RESTRICT, since we are now sometimes using different queries for them. However, the RI_QueryKey also uses the constraint OID as part of the hash key, so even this mistake would not trigger any bad effect unless we also have OID collisions? I'm also not able to reproduce this exact regression.diffs pattern by messing with various conditionals in ri_restrict(), to intentionally cause a confusion between the NO ACTION and RESTRICT cases. Nevertheless, this line of investigation seems most plausible to me at the moment.