Moshe Jacobson wrote
> I have the following query:
> [...]
> The EXPLAIN ANALYZE for this query indicates that all of the tables in the
> query are being joined despite the fact that they are not needed at all.
>
> Why is this?
Without definitions of all the tables involved, as well as knowing what
version you are running this query on, it is impossible to explain why.
https://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.0
Read the section named "Join Removal".
It would seem that in theory at least some of these could be removed -
though maybe not all of them - if you are running 9.0+ (possibly after some
schema changes).
David J.
--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Optimizer-issue-bad-query-plan-tp5806260p5806264.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.