Re: Union strange explain - Mailing list pgsql-admin

From Stephan Szabo
Subject Re: Union strange explain
Date
Msg-id 20020705091034.W27508-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: Union strange explain  ("Gaetano Mendola" <mendola@bigfoot.com>)
List pgsql-admin
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. :)





pgsql-admin by date:

Previous
From: "Stefano Coletta"
Date:
Subject: R: Authentication in batch processing
Next
From: Christopher Smith
Date:
Subject: vaccumdb vacuum memory usage