Stephan Szabo <[EMAIL PROTECTED]> writes: > You also did an optimization, removing the subquery which PostgreSQL > isn't.
I suspect the real issue is that the implied join order is not the same. The view-based query is really a LEFT JOIN (b LEFT JOIN c LEFT JOIN d LEFT JOIN e) while the allegedly equivalent hand expansion is a LEFT JOIN b LEFT JOIN c LEFT JOIN d LEFT JOIN e and since JOIN associates left-to-right, this is not the same thing at all. I'm not even convinced that it gives the same end result ... INNER JOIN is associative but LEFT JOIN is not. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])