Why Adventure Works DW Database Fact tables Does not have a unique index on dimension keys in star schema
I am looking in AdventureWorksDW2008R2 database.
I looked at its fact tables, e.g., FactInternetSales
I was expecting that it will have its primary key or at least I have a unique index on
(ProductKey, OrderDateKey, DueDateKey, ShipDateKey, )
All the columns it has foreign keys on. But to my surprise it has primary key on
[SalesOrderNumber]
, [SalesOrderLineNumber])
2.
Similarly I see FACTSalesQuota has its primary key on
SalesQuotaKey which is a surrogate key instead of DateKey, EmployeeKey
I have read many artcles on internet, while Kimbals book recommends a primary key all the dim tables in its star schema, everyone does not follow this
approach, why?? If in start schema there are many dim tables, primary key can be very long. If we do not have primary key on all dim keys, are there any
performance implications because SQL Server optimzer does some optimizations based on start schema.
January 15th, 2013 7:27am
Hi Prem Mehrotra,
The AdventureWorks DW database is mainly focus on demonstrates how to build a data warehouse, please refer to details about data warehouse design considerations:
http://msdn.microsoft.com/en-us/library/aa902672(v=sql.80).aspx
Thanks,
Eileen
Eileen Zhao
TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
January 16th, 2013 12:04pm