Postgres Query Optimization: Left Join vs. Union All
crunchydata.com
crunchydata.com
Having to decompose and rewrite as a union all manually, frankly sucks. I've got a number of these in my application and had to find each and every one by hitting a pathological data case where things started to fail.