Re: Optimizer issue -- bad query plan?

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Optimizer issue -- bad query plan?
Date: 2014-06-05 22:38:31
Message-ID: 1402007911350-5806264.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Keith Fiske 2014-06-05 22:48:43 Re: Merge a sharded master into a single read-only slave
Previous Message Moshe Jacobson 2014-06-05 22:35:01 Re: Optimizer issue -- bad query plan?