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 1uE8eb-003Vw5-G1 for pgsql-general@arkaria.postgresql.org; Sun, 11 May 2025 15:31:49 +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 1uE8ea-00AUNM-5d for pgsql-general@arkaria.postgresql.org; Sun, 11 May 2025 15:31:48 +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.94.2) (envelope-from ) id 1uE8eZ-00AUNB-QZ for pgsql-general@lists.postgresql.org; Sun, 11 May 2025 15:31:47 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uE8eX-001MuE-0c for pgsql-general@postgresql.org; Sun, 11 May 2025 15:31:47 +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 54BFVdtE893834; Sun, 11 May 2025 11:31:39 -0400 From: Tom Lane To: g l cc: "pgsql-general@postgresql.org" Subject: =?UTF-8?Q?Re:_=E5=9B=9E=E5=A4=8D:_are_the_2_if-statements_in_join?= =?UTF-8?Q?=5Fis=5Flegal()_removable=3F?= In-reply-to: References: <667603.1746892044@sss.pgh.pa.us> Comments: In-reply-to g l message dated "Sun, 11 May 2025 08:26:38 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <893832.1746977499.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 11 May 2025 11:31:39 -0400 Message-ID: <893833.1746977499@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk g l writes: > Then I run the core regression tests with "make installcheck-parallel > " for v18beta1 as the document dictates. When the regression test is don= e, only the last 2 log entries are found in logfile, the first 2 entries a= re not printed at all. I run core regression also with v14.15 and v17.2, t= he results are the same. What test suite do I need to run to cover the fir= st 2 branches, or could you please show me a example query that can cover = them? Thank you very much. The coverage.postgresql.org results are, I believe, for check-world not just the core tests. You might try contrib/postgres_fdw first, as that tends to be the non-core test with the most planner coverage. In any case, the fact that a few of these lines are not reached by test cases doesn't constitute a bug, and it most certainly doesn't mean it'd be safe to remove them. Most of the logic in join_is_legal comes in symmetrical pairs of cases for the two possible orderings of the two input relations. It's just coincidental which of a pair of cases will be exercised by a given phrasing of a SQL query. So I don't feel that we're particularly short on coverage here: one or the other code path is fully exercised in each case, according to the coverage.postgresql.org results. regards, tom lane