Re: Query with correlated join having slow performance

Michael Lewis <[email protected]>
Newsgroups gmane.comp.db.postgresql.general
Message-ID <CAHOFxGqm3PwX2M7k4BPNmX5pVii9tbA=uyLP+Xuhooc_+ZZ36A@mail.gmail.com>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.