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 1t7fwO-0000KD-On for pgsql-hackers@arkaria.postgresql.org; Sun, 03 Nov 2024 19:07:12 +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 1t7fwK-00DYtc-RJ for pgsql-hackers@arkaria.postgresql.org; Sun, 03 Nov 2024 19:07:08 +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 1t7fwK-00DYtU-HE for pgsql-hackers@lists.postgresql.org; Sun, 03 Nov 2024 19:07:08 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t7fwH-004KCf-VF for pgsql-hackers@lists.postgresql.org; Sun, 03 Nov 2024 19:07:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4A3J72at2447692; Sun, 3 Nov 2024 14:07:02 -0500 From: Tom Lane To: "bigbro_wq@hotmail.com" cc: pgsql-hackers Subject: Re: Repeat the condition check twice in function distribute_qual_to_rels In-reply-to: References: Comments: In-reply-to "bigbro_wq@hotmail.com" message dated "Sun, 03 Nov 2024 14:18:47 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2447690.1730660822.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 03 Nov 2024 14:07:02 -0500 Message-ID: <2447691.1730660822@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "bigbro_wq@hotmail.com" writes: > I notice that check the condtion again when after invoked process_equiva= lence and return failed. > /* EC rejected it, so set left_ec/right_ec the hard way ... */ > if (restrictinfo->mergeopfamilies) /* EC might have changed this */ > Above the codes, check the condition again when invoked process_equivale= nce failed, > but it's already under the positive condition "if (restrictinfo->mergeop= families)". > It's necessary ? Yes. See commit 8ec5429e2: the restrictinfo might now be completely different from what it was. (You could have discovered this for yourself by removing the test and seeing what happened.) regards, tom lane