Re: Should Oracle outperform PostgreSQL on a complex

From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, Pål Stenslet <paal(dot)stenslet(at)exie(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Should Oracle outperform PostgreSQL on a complex
Date: 2005-12-17 05:21:50
Message-ID: 43A3A06E.2090900@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Bruce Momjian wrote:
> How are star joins different from what we do now?
>
> ---------------------------------------------------------------------------
>

Recall that a "star" query with n tables means a query where there are
(n - 1) supposedly small tables (dimensions) and 1 large table (fact) -
which has foreign keys to each dimension.

As I understand it, the classic "tar join" is planned like this:

1) The result of the restriction clauses on each of the (small)
dimension tables is computed.
2) The cartesian product of all the results of 1) is formed.
3) The fact (big) table is joined to the pseudo relation formed by 2).

From what I have seen most vendor implementations do not (always)
perform the full cartesion product of the dimensions, but do some of
them, join to the fact, then join to the remaining dimensions afterwards.

There is another join strategy called the "star transformation" where
some of the dimension joins get rewritten as subqueries, then the above
method is used again! This tends to be useful when the cartesion
products would be stupidly large (e.g. "sparse" facts, or few
restriction clauses)

regards

Mark

P.s : Luke or Simon might have a better definition... but thought I'd
chuck in my 2c... :-)

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2005-12-17 07:28:11 Re: Overriding the optimizer
Previous Message Bruce Momjian 2005-12-17 04:28:02 Re: Should Oracle outperform PostgreSQL on a complex