I have found that in many complex queries left join is exponentially faster than a (not) exists clause.
I don't understand why, generally speaking, this is so frequently so effective. __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq