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 1wLPIq-001lE0-1i for pgsql-hackers@arkaria.postgresql.org; Fri, 08 May 2026 17:47:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wLPIp-00AiTV-1Z for pgsql-hackers@arkaria.postgresql.org; Fri, 08 May 2026 17:47:55 +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 1wLPIp-00AiTN-0i for pgsql-hackers@lists.postgresql.org; Fri, 08 May 2026 17:47:55 +0000 Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wLPIm-00000001GXX-3xxI for pgsql-hackers@postgresql.org; Fri, 08 May 2026 17:47:54 +0000 Received: by mail-qt1-x82a.google.com with SMTP id d75a77b69052e-50faeb8317bso16266601cf.2 for ; Fri, 08 May 2026 10:47:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1778262471; cv=none; d=google.com; s=arc-20240605; b=RlyvmMnqPMJaXz/Ky2qgolL383tLcdRXxNnsHFicWNOOCOyflYLjrdAAZbAoQRM2ta ci+3n+2FDCZQ/Tcqt/AHSQBgmlTz2pHklqOCTpWP9/arl0Of65zGKFcUYXGiSbmtdCM8 XDs39zR0N341z9bCdQmhIYDOM+x9zQL/PRccVMhfyPqJNFchGrGKwGhIGbqATJOcQvnP S0uqfIPMVIAgyJmEWopoA+CpLFt0vrPiqPWrRE8a6JE3PQzhenWCpwi4szQs4Hf4Z4Ks scq0Tw/6+Biq7l8IJJTo6aibMM03mux9x8cTf/q2cESKTw0DcvoHwidNMyt9B8/S5yy3 3KfQ== 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=sqdEjjee+qVL4cbCzxzZ6Jg/QAHYJHq60SdWcXU2zHk=; fh=tppwkZDvKrKJDLuNZyX2kA+g7IeMDuD/wutgKf2uWlc=; b=Y7pGoCT9dmd4lNnJnysJHLEfjA1LkvvwGvEruxRPfypRxsgZNkCeMkIUOalIEJ+nzC gxL0B4Sq7nL8I8CUiVtFafsjA995pmdb248iaW3lI4HGXNSkapYRLOg/svm4L5Drv/HX 86Rk/1L7un82kQK+gY1DdL/wLk3MM06BxxJn9HizMnDS0yH7/sjIPvkrtopgINnuPFAD QQUv74UEmCJe8DQEg3/aUEGLqcQP5YXRpznLz/+1kKHr1ZDhMSarIGcKqNHQPzpj0dVb 3rgS6u6OG5xLAuYa40jBFySjrUYNZW6u7kgmjhIsCAq9G396lPdKcjSmNWdJHMF/aHjK zuYQ==; darn=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=20251104; t=1778262471; x=1778867271; darn=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=sqdEjjee+qVL4cbCzxzZ6Jg/QAHYJHq60SdWcXU2zHk=; b=Bnr0HDnYbZiRj/BaMG5zp+4Pt3QOwATO5ETuUOly4iQ+XpX8ldm/QsFe85tb4Zppay 6HxIVrix2BwwPVkJlJLnqrqHS56S48S6bQeS1g8a0aSromSG3cyUZpn6lQmCW5hKVv7t FbZKLdsMYrBtU8roJntKAD9Rt2E1KiLkf+SY6E0ElINxO4le+9ZE3tHJ/idh7jhMORUt Gy5Fv3SVQw2AmyT3aCdjg3XztXE/myDEPRWbsmN/u8zpEiMcfPkpISjplwlmjfsNGzZr pS2598FfkTAuFynwQxcDA4Y05fcIf+Ou9ncJ1iJTxe5AAyhMOKCzluJYKcxXFxSjcFD/ 3sLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778262471; x=1778867271; 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=sqdEjjee+qVL4cbCzxzZ6Jg/QAHYJHq60SdWcXU2zHk=; b=qykt1bzbfS1a1sbmaurxRLv+u3FeLS5qnLB+ovcOyGu2WURD7O4Rm3nEqsmKVs2jS0 knMrDKQ6zzKxyfQtjvMcnqeX1Ir1OXSlE0UW2o+CYnbaGu3Ku4tOtSynqDxABwpaeKS5 bMXG2vICkeCwHjTia2r7TIS8KfHDiSgDQmgBVBJrtxlUvSNbqUBm2YnLxs9xKumIkfHe 75KNFcYMD/2R1xp+GvI8B2y036uEt+muHV1MkwJJGoaenrICEHvVG0Uaq86Z2zP1CTEz LHuZKn9OjSEG6e0+j9SIYV4uVsZS6lMxkzuNMqmTALuSzgxf6Jb14N+hiDBYRB1VQKOr ymyQ== X-Gm-Message-State: AOJu0Yxnx2nLbry+rE2VolxwFFGODMO4jF+43w3/ZaRKWiA+HsJQSa+1 m5m8xbBnAHTGbTWIMAV6TMKZzv/38c18gOJr5sgzEqDd+A4Hp4ktcQMFdWVvLrF5mq+fD82isJ2 YXlhNUuuZgxixb83uuaJr6SPnQTUO67U= X-Gm-Gg: AeBDievEPDHrijH6gMuTZGQyGQ4a5yZEkL0v1tyvYYpOaVXBodJiH9TW/qpWHrycR4q w5waJTOgcg498fuw/6cNglMaKyn11J/1m5ZxKYbBl2W+yzBiaElabx3al5ERqbsjdwtyddU4xIO 7Q8H0zJ8FZ7MgCBDHTF97RCLnz1f0TTyTy3RGa85zOdODFWulI4wjit82RiWW/4qyXhXrqt/GDZ 21QynIlTa821Pu4LezwnfxVKhkZryrpAVkJ2tjLxZpzBbIpYevIfsiDozcQbfUH4anh8+jS6XRC G3a1biFErr0Hr/GOjAZ7j81KHfCMXdIen5NNZKoWVFxje7zrJKQvV28yZ8NPSa5dEZfYSMIPLae ShDRZDCQafvDpDqp5 X-Received: by 2002:a05:622a:1104:b0:50e:6377:197d with SMTP id d75a77b69052e-5148e7caaa6mr50912051cf.8.1778262471050; Fri, 08 May 2026 10:47:51 -0700 (PDT) MIME-Version: 1.0 References: <7B0EC0EC-5461-41EF-9B31-F9BBE608DEA5@gmail.com> In-Reply-To: <7B0EC0EC-5461-41EF-9B31-F9BBE608DEA5@gmail.com> From: Kirill Reshke Date: Fri, 8 May 2026 22:47:39 +0500 X-Gm-Features: AVHnY4J06SWveHIhaI9R5r0X-ymFUzssT2HF38fZKbglAZ0QdlL4YkJtU-vYMB0 Message-ID: Subject: Re: Fix REPACK with WITHOUT OVERLAPS replica identity indexes To: Chao Li Cc: PostgreSQL-development 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 Fri, 8 May 2026 at 09:22, Chao Li wrote: > > Hi, > > While testing UPDATE FOR PORTION OF, I started wondering whether REPACK s= upports temporal tables. In theory, it should, because temporal WITHOUT OVE= RLAPS indexes can be used as replica identity indexes. So I created a test = script, repack_temporal.spec, which is included in the attached patch, and = it failed. > > I found that REPACK hard-codes BTEqualStrategyNumber when calling get_opf= amily_member(). That seems wrong, because build_replindex_scan_key() uses I= ndexAmTranslateCompareType() to get the equality strategy for COMPARE_EQ. > > After fixing the hard-coded BTEqualStrategyNumber, the temporal test pass= ed. Then I added another test for multirange, repack_temporal_multirange.sp= ec, which also failed. The reason is that find_target_tuple() uses the iden= tity index to find the first tuple and returns it directly, but a lossy ind= ex scan may return false positives and require recheck. > > Please see the attached patch for the fix details and test scripts. > > Best regards, > -- > Chao Li (Evan) > HighGo Software Co., Ltd. > https://www.highgo.com/ > your analysis appears correct to me > + while (index_getnext_slot(scan, ForwardScanDirection, retrieved)) > + { > + if (scan->xs_recheck && !identity_key_equal(chgcxt, locator, retrieved)= ) > + continue; > + > + retval =3D true; > + break; > + } Should we add CFI() ? Also, do we really need isolation tests and inj points here? Doesn't a simple regression test for REPACK execute the same code? --=20 Best regards, Kirill Reshke