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_nestloopenable_nestloopenable_nestloop?