From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Gaetano Mendola <mendola@bigfoot.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Union strange explain
Date: Fri, 5 Jul 2002 09:15:27 -0700 (PDT)
Message-ID: <20020705091034.W27508-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <005001c2240d$23d176e0$070afea9@GMENDOLA2>
On Fri, 5 Jul 2002, Gaetano Mendola wrote:
> Stephan wrote:
> > number of rows returned). I think there was some question about
> > whether it was safe to do that optimization (ie,
> > is select * from (a union [all] b) where condition
> > always the same as
> > select * from a where condition union [all]
> > select * from b where condition
> > )
>
> Yes but with a View the condition is always extern.
> I'm understanding that I don't have any possibility to
> optimize that view, I'm wrong ?
Right now, I don't think there's much you can do using
a view.
Until we at least think we know what the safe conditions
are to make that optimization, we can't do so since we
might return incorrect results if the optimization is
performed in a place it doesn't apply. If you want
to do the legwork to show what (if any conditions)
need to be met to do the optimization, we'd certainly
be happy. :)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: sszabo@megazone23.bigpanda.com, mendola@bigfoot.com
Subject: Re: Union strange explain
In-Reply-To: <20020705091034.W27508-100000@megazone23.bigpanda.com>
References: <005001c2240d$23d176e0$070afea9@GMENDOLA2> <20020705091034.W27508-100000@megazone23.bigpanda.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