dbTalk Databases Forums  

Fact Table Composite Keys

comp.databases.olap comp.databases.olap


Discuss Fact Table Composite Keys in the comp.databases.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Daniel Stone
 
Posts: n/a

Default Fact Table Composite Keys - 07-26-2004 , 03:03 AM






Hope you may be able to help.

I am developing a fairly standard star schema with a central fact
table and 5 dimension tables. All dimension tables contain a surrogate
primary key. It is a composite of these keys that I plan to create the
fact table primary key with.

Am I correct in saying that if i use the date key as the first in the
composite and create a clustered index on this primary key i will have
data sorted by date always. My concern is that a a fact could contain
a small customer no and product no therefore would the composite key
be sorted on date or not just a combination of these values.

Alternatively what if i cretated the composite key as unique only and
then carried out a clustered index on date key, customee key etc? Is
there a max no of columns I shouldn't exceed for a clustered index?

Hope this makes sense.

Any help is most appreciated.

Cheers

Daniel

Reply With Quote
  #2  
Old   
Domenico Discepola
 
Posts: n/a

Default Re: Fact Table Composite Keys - 07-26-2004 , 10:53 AM







"Daniel Stone" <danielstone75 (AT) hotmail (DOT) com> wrote

Quote:
Hope you may be able to help.

I am developing a fairly standard star schema with a central fact
table and 5 dimension tables. All dimension tables contain a surrogate
primary key. It is a composite of these keys that I plan to create the
fact table primary key with.

Am I correct in saying that if i use the date key as the first in the
composite and create a clustered index on this primary key i will have
data sorted by date always. My concern is that a a fact could contain
a small customer no and product no therefore would the composite key
be sorted on date or not just a combination of these values.

Alternatively what if i cretated the composite key as unique only and
then carried out a clustered index on date key, customee key etc? Is
there a max no of columns I shouldn't exceed for a clustered index?

Why not design your fact table with a surrogate key that will be your
primary key?




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.