Re: sub-select with aggregate - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: sub-select with aggregate
Date
Msg-id 20021024093022.A21018-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: sub-select with aggregate  ("Tomasz Myrta" <jasiek@klaster.net>)
Responses Re: sub-select with aggregate
List pgsql-sql
On Thu, 24 Oct 2002, Tomasz Myrta wrote:

> > The system doesn't realize that it can limit the subquery when the only
> > things it has is the join clause and the limiting clause on the other
> > table.  Like Tom's message about the other view, it won't imply that
> > X.foo=12345 from foo=12345 when the exposed foo is B.foo.
>
> Is this what we should expect, or rather a bug?
> The system knows how to join tables, but fails with joining views or
> subselects :-(

It knows how to join them, it doesn't know that it can change the
clauses given to it in order to make it more efficient.

Basically, as I understand it,select * from a,b where a.a=b.a and a.a=3;
isn't going to realize that b.a=3 and act as if
you typed that. It may consider an index scan in
a nested loop for a.a=b.a, but that's not quite
the same.




pgsql-sql by date:

Previous
From: Achilleus Mantzios
Date:
Subject: Re: redirect query results to my (stdout) screen
Next
From: Tom Lane
Date:
Subject: Re: sub-select with aggregate