X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id EFCBF9DCACF for ; Sat, 17 Dec 2005 12:43:33 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49408-06 for ; Sat, 17 Dec 2005 12:43:32 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by postgresql.org (Postfix) with ESMTP id 7B2249DCA43 for ; Sat, 17 Dec 2005 12:43:31 -0400 (AST) Received: from candle.pha.pa.us ([71.225.87.206]) by comcast.net (sccrmhc12) with ESMTP id <20051217164315012007iihde>; Sat, 17 Dec 2005 16:43:30 +0000 Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id jBHGhFA04982; Sat, 17 Dec 2005 11:43:15 -0500 (EST) From: Bruce Momjian Message-Id: <200512171643.jBHGhFA04982@candle.pha.pa.us> Subject: Re: Should Oracle outperform PostgreSQL on a complex In-Reply-To: <1134810953.2964.117.camel@localhost.localdomain> To: Simon Riggs Date: Sat, 17 Dec 2005 11:43:15 -0500 (EST) CC: =?ISO-8859-1?Q?P=E5l_Stenslet?= , pgsql-performance@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.133 required=5 tests=[AWL=0.133] X-Spam-Score: 0.133 X-Spam-Level: X-Archive-Number: 200512/426 X-Sequence-Number: 16247 OK, so while our bitmap scan allows multiple indexes to be joined to get to heap rows, a star joins allows multiple dimensions _tables_ to be joined to index into a larger main fact table --- interesting. Added to TODO: * Allow star join optimizations While our bitmap scan allows multiple indexes to be joined to get to heap rows, a star joins allows multiple dimension _tables_ to be joined to index into a larger main fact table. The join is usually performed by either creating a cartesian product of all the dimmension tables and doing a single join on that product or using subselects to create bitmaps of each dimmension table match and merge the bitmaps to perform the join on the fact table. --------------------------------------------------------------------------- Simon Riggs wrote: > On Fri, 2005-12-16 at 23:28 -0500, Bruce Momjian wrote: > > How are star joins different from what we do now? > > Various ways of doing them, but all use plans that you wouldn't have > come up with via normal join planning. > > Methods: > 1. join all N small tables together in a cartesian product, then join to > main Large table once (rather than N times) > 2. transform joins into subselects, then return subselect rows via an > index bitmap. Joins are performed via a bitmap addition process. > > You can fake (1) yourself with a temporary table, and the basics for (2) > are now in place also. > > The characteristics of these joins make them suitable for large Data > Warehouses with Fact-Dimension style designs. > > Many RDBMS have this, but we need to be careful of patent claims. I'm > sure there's a way through that, but I'm not looking for it yet. Anybody > else wishing to assist with a detailed analysis would be much > appreciated. > > Best Regards, Simon Riggs > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073