Re: Optimizer issue -- bad query plan? - Mailing list pgsql-general

From Tom Lane
Subject Re: Optimizer issue -- bad query plan?
Date
Msg-id 26950.1402010374@sss.pgh.pa.us
Whole thread Raw
In response to Re: Optimizer issue -- bad query plan?  (Moshe Jacobson <moshe@neadwerx.com>)
Responses Re: Optimizer issue -- bad query plan?
List pgsql-general
Moshe Jacobson <moshe@neadwerx.com> writes:
> On Thu, Jun 5, 2014 at 6:38 PM, David G Johnston <david.g.johnston@gmail.com
>> wrote:
>> 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.

> Right, I'm aware of this feature -- I'm just curious why it's not working!

So are we, but you've not provided a self-contained example.

I suspect that there's something you haven't shown us that means that the
view subquery doesn't get flattened into the calling query, so that the
planner won't be aware while planning the subquery that not all its output
columns are actually used.  But that's just a guess unsupported by
evidence.  We need to see the actual view definition and calling query,
not a simplified "equivalent" query.

            regards, tom lane


pgsql-general by date:

Previous
From: Moshe Jacobson
Date:
Subject: Re: Optimizer issue -- bad query plan?
Next
From: Adrian Klaver
Date:
Subject: Re: PostgreSQL 9.2.4 + CentOS 6.5 64 bit - segfault error in initdb