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 1jlIeX-0004AJ-Tw for pgsql-performance@arkaria.postgresql.org; Tue, 16 Jun 2020 20:57:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jlIeV-0004LX-Mr for pgsql-performance@arkaria.postgresql.org; Tue, 16 Jun 2020 20:57:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jlIeV-0004LQ-Af for pgsql-performance@lists.postgresql.org; Tue, 16 Jun 2020 20:57:51 +0000 Received: from sonic311-24.consmr.mail.ne1.yahoo.com ([66.163.188.205]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jlIeS-0002aV-Jv for pgsql-performance@lists.postgresql.org; Tue, 16 Jun 2020 20:57:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1592341066; bh=o5hAYudfYhBW+qbzOqnQvSYK98g52mTvvoaDIQO7QUs=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject; b=gh2/aKG9yldkrMUc3ZrZYGlyK2mEKz3TDtHTg9CDUlrBaGe8Ypd6SyEU7zCczK6rKZ7jsNAJIO2+W0MBWXWZ4EES9iayiZS4tIMCB4UmNjeSfe0U0kSEzCJX8DdnsWtJooT9kpdUEsvp/Q1Hs9Ji8v6oeR6VuzcR2v1CRrzs7FazEnVrQcXkMmpqmcsthG3kiAn1+01ut3rgXJTJW0VaW5omyUZFNUT5HzZVKj8UxHWJ1K16dXnEHJN/EUw2VRBcckHrI6PElkhPcuJUQ+XF0MB/a8TKQ1BKZ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msLxJSSLxtyccXufA9.v.v65RStx1B xzTMeoyXQ7pa5z8JFuS9uZGp5HGG.4QB7ObsK8QfDFh1Y4RavFennCp2nCTqWdzmMlpx28VZ1CVp 9HC3_an8gfs8aMzWIt2gVDVmOFnLNk7189cX2pJ0Hk0RguzzqtZYxTlFtUG8AW48T9IdvyXnapy_ pvF9is5xNI19eRhm3C4LtyzTz9KeXtIILbYZfnuvvfrQl67he.dclByDVqtxIYFohWQR_uRpvH9a mpJ_tiaV7RCa0abw9trIqLPxuywxW0ioVzgwNb6B.zMUxFwDrj3LgfCJKElLa1Beed31XWqlKjR_ soe5BywHtDY1qbhgYMBD2khzeYQNYB4K0CBrOIiKY2kuzuQ-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.ne1.yahoo.com with HTTP; Tue, 16 Jun 2020 20:57:46 +0000 Date: Tue, 16 Jun 2020 20:57:43 +0000 (UTC) From: Nagaraj Raj To: Justin Pryzby Cc: Pgsql Performance Message-ID: <2019958432.1888473.1592341063368@mail.yahoo.com> In-Reply-To: <20200616204659.GA20513@telsasoft.com> References: <574079062.1873527.1592339731136.ref@mail.yahoo.com> <574079062.1873527.1592339731136@mail.yahoo.com> <20200616204659.GA20513@telsasoft.com> Subject: Re: simple query running for ever MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1888472_124108254.1592341063367" X-Mailer: WebService/1.1.16119 YMailNodin Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36 Content-Length: 5086 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_1888472_124108254.1592341063367 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Justin, My apologies, I missed that. Yes, I change work mem to 2GB but didn't see any difference. So, as your su= ggestion removed the distinct on pk and added a multi-column index so query= planner did index-only can that is fixed the issue and query completed in = 1Min. Best regards, Rj On Tuesday, June 16, 2020, 01:47:21 PM PDT, Justin Pryzby wrote: =20 =20 On Tue, Jun 16, 2020 at 08:35:31PM +0000, Nagaraj Raj wrote: > I wrote a simple query, and it is taking too long, not sure what is wrong= in it, even its not giving EXPLAIN ANALYZE. Is this related to last week's question ? https://www.postgresql.org/message-id/1211705382.726951.1592174752720%40mai= l.yahoo.com Was that issue resolved ? I didn't see answers to a few questions I asked there. > select T0."physical_address_sid", T0."individual_entity_proxy_id", T2."in= frrd_hh_rank_nbr" > from "cms_prospects".PROSPECT T0 > --inner join "sas_prs_tmp".DEDUPE3583E3F18 T1 on T0."individual_entity_pr= oxy_id" =3D T1."individual_entity_proxy_id" > left join "cms_prospects".INDIVIDUAL_DEMOGRAPHIC T2 on T0."individual_ent= ity_proxy_id" =3D T2."individual_entity_proxy_id"=20 >=20 > "Merge Left Join=C2=A0 (cost=3D55.96..18147747.08 rows=3D213620928 width= =3D20)" > "=C2=A0 Merge Cond: (t0.individual_entity_proxy_id =3D t2.individual_enti= ty_proxy_id)" > "=C2=A0 ->=C2=A0 Index Scan using pk_prospect on prospect t0=C2=A0 (cost= =3D0.57..10831606.89 rows=3D213620928 width=3D16)" > "=C2=A0 ->=C2=A0 Index Only Scan using indxp_individual_demo_infrrd_hh_ra= nk_nbr on individual_demographic t2=C2=A0 (cost=3D0.57..5013756.93 rows=3D2= 60652064 width=3D12)" >=20 > Any suggestions or help would be highly appreciated.=20 >=20 > Best regards, > Rj =20 ------=_Part_1888472_124108254.1592341063367 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Justin,

My apologies, I missed that.

= Yes, I change work mem to 2GB but didn't see any difference. So, as you= r suggestion removed the distinct on pk and added a multi-column index so q= uery planner did index-only can that is fixed the issue and query completed= in 1Min.

Best regards,
Rj
On Tuesday,= June 16, 2020, 01:47:21 PM PDT, Justin Pryzby <pryzby@telsasoft.com>= wrote:

=

On Tue, Jun 16, 2020 at 08:35:31PM +00= 00, Nagaraj Raj wrote:
> I wrote a simple query, and i= t is taking too long, not sure what is wrong in it, even its not giving EXP= LAIN ANALYZE.

Is this related to last = week's question ?
https://www.postgresql.org/message-id/1211705382.726951.1= 592174752720%40mail.yahoo.com

Was = that issue resolved ?

I didn't see ans= wers to a few questions I asked there.


> select T0."physical_ad= dress_sid", T0."individual_entity_proxy_id", T2."infrrd_hh_rank_nbr"
> from "cms_prospects".PROSPECT T0
> --= inner join "sas_prs_tmp".DEDUPE3583E3F18 T1 on T0."individual_entity_proxy_= id" =3D T1."individual_entity_proxy_id"
> left join "c= ms_prospects".INDIVIDUAL_DEMOGRAPHIC T2 on T0."individual_entity_proxy_id" = =3D T2."individual_entity_proxy_id"
>
> "Merge Left Join  (cost=3D55.96..18147747.08 rows=3D213620928= width=3D20)"
> "  Merge Cond: (t0.individual_ent= ity_proxy_id =3D t2.individual_entity_proxy_id)"
> "&n= bsp; ->  Index Scan using pk_prospect on prospect t0  (cost=3D= 0.57..10831606.89 rows=3D213620928 width=3D16)"
> "&nb= sp; ->  Index Only Scan using indxp_individual_demo_infrrd_hh_rank_= nbr on individual_demographic t2  (cost=3D0.57..5013756.93 rows=3D2606= 52064 width=3D12)"
>
> Any sugge= stions or help would be highly appreciated.
>
> Best regards,
> Rj
=

=
------=_Part_1888472_124108254.1592341063367--