Planner choosing nested loop in place of Hashjoin

From: Praneel Devisetty <devisettypraneel(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Planner choosing nested loop in place of Hashjoin
Date: 2023-03-07 12:14:08
Message-ID: CAHnVB4D-VWf8rx17diSj7FJ=gfg7N_qjr2wES9NpN4iVNcbvXw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi,

I have a query which is taking roughly 10mins to complete and the query
planner is choosing a nested loop.

query and query plan with analyze,verbose,buffers
qsEn | explain.depesz.com <https://explain.depesz.com/s/qsEn#html>

Disabling the nested loop on session is allowing the query planner to
choose a better plan and complete it in 2mins.Stats are up to date and
analyze was performed a few hours ago.

Any suggestions on what is causing the planner to choose a nested loop in
place of hash and how can we get the query to choose a better plan without
disabling the enable_nestloopenable_nestloopenable_nestloop enable_nestloop
enable_nestloop?

Thanks
Praneel

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Samed YILDIRIM 2023-03-11 10:31:04 Re: Planner choosing nested loop in place of Hashjoin
Previous Message Andrew Dunstan 2023-03-01 21:36:38 Re: INSERT statement going in IPC Wait_event