Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jeNIb-0002sZ-IF for pgsql-general@arkaria.postgresql.org; Thu, 28 May 2020 18:30:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jeNIa-0003LZ-GR for pgsql-general@arkaria.postgresql.org; Thu, 28 May 2020 18:30:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jeMEr-0005FV-OS for pgsql-general@lists.postgresql.org; Thu, 28 May 2020 17:22:41 +0000 Received: from ums-loy-gw1.concordia.ca ([132.205.157.20]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jeMEp-00042m-4J for pgsql-general@lists.postgresql.org; Thu, 28 May 2020 17:22:41 +0000 Received: from algol.concordia.ca (ums-sgw-mbs2.concordia.ca [132.205.123.135]) by ums-loy-gw1.concordia.ca with ESMTP id 04SHMW8D030808-04SHMW8F030808 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Thu, 28 May 2020 13:22:32 -0400 Received: from UMS-SGW-MBS1.concordia.ca (132.205.123.130) by ums-sgw-mbs2.concordia.ca (132.205.123.135) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 28 May 2020 13:22:32 -0400 Received: from UMS-SGW-MBS1.concordia.ca ([fe80::e1e3:33d4:61aa:80df]) by ums-sgw-mbs1.concordia.ca ([fe80::e1e3:33d4:61aa:80df%19]) with mapi id 15.00.1473.003; Thu, 28 May 2020 13:22:32 -0400 From: Ying Lu To: Adrian Klaver , "pgsql-general@lists.postgresql.org" Subject: Re: psql12.3 + jdbc_fdw - return wrong query results by using OR Thread-Topic: psql12.3 + jdbc_fdw - return wrong query results by using OR Thread-Index: AQHWNQ6m7eV2o6cZz0G6BiGR760iI6i9t1d6gABF9YD//8FfpQ== Date: Thu, 28 May 2020 17:22:32 +0000 Message-ID: <1590686553201.26345@concordia.ca> References: <20200528113956.767qptz1cg44cw0g@webmail.encs.concordia.ca> <625d4581-6b92-6368-f1a2-eedf4f6c890a@aklaver.com> <1590685166535.433@concordia.ca>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [132.205.244.6] x-pmwin-version: 4.0.2, Antivirus-Engine: 3.77.1, Antivirus-Data: 5.75 x-puremessage: [Scanned] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-FEAS-DICTIONARY: 1(Disclaimer-Exclude:1) X-FEAS-CONTENT-MODIFICATION: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; d=concordia.ca; s=dkim-concordia_ca; c=relaxed/relaxed; h=from:to:subject:date:message-id:references:content-type:mime-version; bh=AsCmKa590xaCa5LuQpqSaEfdrXWN5P31Y6bGHSB12h8=; b=BRttBW2pPQ8/3xuHzAIwZ8TSyfcQvUr2RKozdb2hgu7NN0I0gthLaVF1j9UpQfFtQu2OA+omZl27 VZD+XeL92ZZrwmZ3M6SdOaaMXXTM2ERXTVN0wIaAESI6IXdIl6p7s9WSGIAduFmwAI+r35XrBpmo TuWPT5tn6Evx/bWQMXKpF45T+NykHAd6y2UHuqVSNV4oyq12sYpSbNtUFWn8OvM32aKbwfl2q6Rk xTYAcu03iJFs2LLoCHbFCgYDPMVEYdyr30wWnCmg4lVddFPWeuLuXgDjoGs6ZLXC2phzgxigEzBc irY8vzaSPQ/w2lwxi0RD5T4eaXwo4gxtj/6ymg== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, =0A= =0A= Please find the info for both SQLs (removed yr)=0A= =0A= For Q1: =0A= =0A= QUERY PLAN=0A= ---------------------------------------------------------------------------= ----------------------------------------------------=0A= Aggregate (cost=3D5.40..5.41 rows=3D1 width=3D8) (actual time=3D1267.001.= .1267.001 rows=3D1 loops=3D1)=0A= -> Hash Join (cost=3D2.10..4.78 rows=3D245 width=3D0) (actual time=3D0= .134..1265.840 rows=3D2650 loops=3D1)=0A= Hash Cond: (a.c1 =3D b.c1)=0A= -> Foreign Scan on oracle_t1 a (cost=3D0.00..0.00 rows=3D1000 wi= dth=3D32) (actual time=3D0.026..1257.823 rows=3D14625 loops=3D1)=0A= -> Hash (cost=3D1.49..1.49 rows=3D49 width=3D5) (actual time=3D0= .030..0.030 rows=3D49 loops=3D1)=0A= Buckets: 1024 Batches: 1 Memory Usage: 10kB=0A= -> Seq Scan on local_t1 b (cost=3D0.00..1.49 rows=3D49 wid= th=3D5) (actual time=3D0.014..0.021 rows=3D49 loops=3D1)=0A= Planning Time: 0.178 ms=0A= Execution Time: 1363.482 ms=0A= =0A= =0A= For Q2: =0A= =0A= QUERY PLAN=0A= ---------------------------------------------------------------------------= -------------------------------------------------=0A= Aggregate (cost=3D737.71..737.72 rows=3D1 width=3D8) (actual time=3D1197.= 366..1197.366 rows=3D1 loops=3D1)=0A= -> Nested Loop (cost=3D0.00..736.49 rows=3D489 width=3D0) (actual time= =3D16.649..1197.292 rows=3D70 loops=3D1)=0A= Join Filter: ((a.c1 =3D b.c1) OR (a.c2 =3D b.c1))=0A= Rows Removed by Join Filter: 14555=0A= -> Seq Scan on local_t1 b (cost=3D0.00..1.49 rows=3D49 width=3D5= ) (actual time=3D0.016..0.023 rows=3D49 loops=3D1)=0A= -> Foreign Scan on oracle_t1 a (cost=3D0.00..0.00 rows=3D1000 wi= dth=3D64) (actual time=3D0.002..24.284 rows=3D298 loops=3D49)=0A= Planning Time: 0.972 ms=0A= Execution Time: 1299.896 ms=0A= =0A= =0A= Thanks a lot.=