Re: Query with correlated join having slow performance - Mailing list pgsql-general

From Michael Lewis
Subject Re: Query with correlated join having slow performance
Date
Msg-id CAHOFxGqm3PwX2M7k4BPNmX5pVii9tbA=uyLP+Xuhooc_+ZZ36A@mail.gmail.com
Whole thread Raw
In response to Query with correlated join having slow performance  (saket bansal <saket.tcs@gmail.com>)
Responses Re: Query with correlated join having slow performance
List pgsql-general
I'd suggest re-writing your query to avoid ORs whenever possible. Is this generated by an ORM or subject to change with filters selected in application or can you totally control it on DB side?

It may be hugely more performant to simply rewrite this as (almost) the same query twice UNION ALL'd together to separate the productalt1_.alt_pdt_dbky OR productalt1_.orgnl_pdt_dbky conditions.

pgsql-general by date:

Previous
From: saket bansal
Date:
Subject: Query with correlated join having slow performance
Next
From: Justin
Date:
Subject: Re: Query with correlated join having slow performance