Re: [SQL] Sub-select speed.

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Mitch Vincent <mitch(at)venux(dot)net>, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] Sub-select speed.
Date: 1999-12-18 00:32:05
Message-ID: 199912180032.TAA19361@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> >> There has been some talk of automatically rewriting queries to eliminate
> >> unnecessary sub-selects, but I don't foresee it getting done for a
> >> while yet.
>
> > Tom, you mentioned that subselects use nested join, but they could be
> > hardcoded to use hash join. My opinion is that this should be done if
> > it is easy.
>
> That would probably help for uncorrelated subselects (where no variable
> from the outer query is referenced in the inner one). For correlated
> subselects, such as this one is, hashing the subselect result isn't
> going to help much --- the real problem is that the subselect is
> repeated afresh for each outer tuple.

Oh, I was thinking in general of our EXISTS() workaround and if we could
help that by forcing hash joins.

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 1999-12-18 01:10:37 Re: [SQL] avg() on numeric ?
Previous Message Jan Wieck 1999-12-17 23:43:51 Re: [SQL] avg() on numeric ?