From: Matt Klinker <mklinker@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: [SOLVED] Query plan excluding index on view
Date: Mon, 7 Apr 2008 09:46:38 -0600
Message-ID: <3bda20f60804070846w6e89fa2bg3676ef0d00d14fec@mail.gmail.com> (raw)
In-Reply-To: <28880.1207369243@sss.pgh.pa.us>
References: <3bda20f60804031631j177b42e2u82b5033fd23c2293@mail.gmail.com>
<28177.1207266621@sss.pgh.pa.us>
<3bda20f60804031654q7991de08m1254964511632acf@mail.gmail.com>
<29828.1207271948@sss.pgh.pa.us>
<3bda20f60804032158u4f6765e3t8b0debad3e7f5ceb@mail.gmail.com>
<4767.1207288167@sss.pgh.pa.us>
<3bda20f60804040726m15e1b9caqad3883cba960bab0@mail.gmail.com>
<28880.1207369243@sss.pgh.pa.us>
Removing the constants definitely did take care of the issue on 8.3 (still
same query plan on 8.1). Thanks for your help in getting this resolved, and
sorry again for not including all relevant information on my initial request
On Fri, Apr 4, 2008 at 10:20 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> "Matt Klinker" <mklinker@gmail.com> writes:
> > --Joined View:
> > CREATE OR REPLACE VIEW directory_listing AS
> > SELECT school.id, school.name, school.description, 119075291 AS
> > listing_type_fid
> > FROM school
> > UNION ALL
> > SELECT company.id, company.name, company.description, 119074833 AS
> > listing_type_fid
> > FROM company;
>
> Ah, there's the problem :-(. Can you get rid of the constants here?
> The planner's currently not smart about UNION ALL subqueries unless
> their SELECT lists contain just simple column references.
>
> (Yes, fixing that is on the todo list, but don't hold your breath...
> it'll be 8.4 material at the earliest.)
>
> regards, tom lane
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: mklinker@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: [SOLVED] Query plan excluding index on view
In-Reply-To: <3bda20f60804070846w6e89fa2bg3676ef0d00d14fec@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox