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 1srVZ2-002DEm-1v for pgsql-general@arkaria.postgresql.org; Fri, 20 Sep 2024 04:48:16 +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 1srVYz-00F42v-DE for pgsql-general@arkaria.postgresql.org; Fri, 20 Sep 2024 04:48:14 +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 1srVYz-00F407-1X for pgsql-general@lists.postgresql.org; Fri, 20 Sep 2024 04:48:14 +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 1srVYu-0007Jc-2o for pgsql-general@lists.postgresql.org; Fri, 20 Sep 2024 04:48:13 +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 48K4m5952359012; Fri, 20 Sep 2024 00:48:05 -0400 From: Tom Lane To: Siraj G cc: Adrian Klaver , pgsql-general@lists.postgresql.org Subject: Re: Need assistance in converting subqueries to joins In-reply-to: References: <2cf838b6-2e49-42a0-8d8c-98649127dd4b@aklaver.com> Comments: In-reply-to Siraj G message dated "Fri, 20 Sep 2024 09:58:12 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2359010.1726807685.1@sss.pgh.pa.us> Date: Fri, 20 Sep 2024 00:48:05 -0400 Message-ID: <2359011.1726807685@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Siraj G writes: > Please find below the query in the format and its execution plan: [ blink... ] I'm not sure what you are using there, but it is *not* Postgres. There are assorted entries in the execution plan that community Postgres has never heard of, such as > -> Remove duplicate (P0, IS_SEC_FILT) rows using temporary table > (weedout) (cost=2085.53 rows=1988) (actual time=0.321..22600.652 > rows=10298 loops=1) > -> Single-row index lookup on P0 using IS_PROJ_PK > (IS_PROJ_GUID=T0.IS_PROJ_GUID, IS_REPOSITORY_ID=R0.REP_ID) (cost=0.63 > rows=1) (actual time=0.000..0.000 rows=1 loops=50) Maybe this is RDS, or Aurora, or Greenplum, or one of many other commercial forks of Postgres? In any case you'd get more on-point advice from their support forums than from the PG community. It looks like this is a fork that has installed its own underlying table engine, meaning that what we know about performance may not be terribly relevant. regards, tom lane