Re: View vs. Statement Query Plan

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Curt Sampson <cjs(at)cynic(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: View vs. Statement Query Plan
Date: 2002-06-05 08:47:16
Message-ID: 20020605184716.B9784@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 04, 2002 at 07:15:59PM -0400, Tom Lane wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> > On Tue, Jun 04, 2002 at 01:15:38AM -0400, Tom Lane wrote:
> >> I don't doubt that this transformation is valid in some cases ... but
> >> I do doubt that it is valid in all cases. If someone can supply a
> >> rigorous proof about when it is valid, I'd be willing to look into
> >> doing the necessary programming.
>
> > IIRC, union does an implicit DISTINCT (there's UNION ALL, right). So if what
> > is being selected is anything other than a simple statement, it'll be very
> > hard to prove equivalence (i guess this is what the iscachable is
> > for).
>
> Yeah, the UNION vs. UNION ALL difference is one of the things that would
> need to be thought about. I think it's more likely that the
> transformation would work for UNION ALL than for UNION ... but I have
> not had the time to try to work it out.

One thing I don't know and that is how closely SQL follows relational
algebra. Is it close enough that you can prove results in relational algebra
and have them work in SQL. Or there enough special cases to make that
tricky.
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mark kirkwood 2002-06-05 08:50:09 Re^3 : Solaris Performance - 64 bit puzzle
Previous Message Mike Mascari 2002-06-05 06:29:50 Re: Using C++ with CREATE FUNCTION