Re: Optimizer issue -- bad query plan?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Moshe Jacobson <moshe(at)neadwerx(dot)com>
Cc: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Optimizer issue -- bad query plan?
Date: 2014-06-05 23:19:34
Message-ID: 26950.1402010374@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Moshe Jacobson <moshe(at)neadwerx(dot)com> writes:
> On Thu, Jun 5, 2014 at 6:38 PM, David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-06-06 00:18:27 Re: PostgreSQL 9.2.4 + CentOS 6.5 64 bit - segfault error in initdb
Previous Message Moshe Jacobson 2014-06-05 22:54:43 Re: Optimizer issue -- bad query plan?