Link to home
Start Free TrialLog in
Avatar of enrique_aeo
enrique_aeo

asked on

Dimension table indexes

hi experts

about Dimension table indexes
What is correct?

1. Clustered index on surrogate key column
or
2. Create a clustered business key index
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of enrique_aeo
enrique_aeo

ASKER

i am trying create dimension table.
it is database OLAP - datawarehouse - The Dimensional Model
^^^  That doesn't tell me anything that wasn't stated very generically in your original question.  Can you provide us some context, such as the table schemas of the dim and facts in question?
in the offical course of microsoft sql server 2012 10777A - Designing and Implementing a Data Warehouse says:

Dimension table indexes: Create a clustered business key index

but
in the offical course of microsoft sql server 2016 20767A - Designing and Implementing a Data Warehouse  says:
Dimension table indexes: Clustered index on surrogate key column

i am very confused
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think that
Dimension table indexes: Create a clustered business key index
ProductAltKey = clustered business key index

CREATE TABLE DimProduct
(ProductKey int identity NOT NULL PRIMARY KEY NONCLUSTERED,
 ProductAltKey nvarchar(10) NOT NULL,
 ProductName nvarchar(50) NULL,
 ProductDescription nvarchar(100) NULL,
 ProductCategoryName nvarchar(50))
GO

CREATE CLUSTERED INDEX IX_DimProduct_ProductAltKey
    ON dbo.DimProduct (ProductAltKey);  
GO  

If I process a file with 5,000 products I think it will be faster if the business key is a cluster index, what do you think?
Explain to me what you believe the definition is of a clustered business index.

My definition is one or more columns, and possibly concatenated letters and numbers (e.g. MN00178949).   These will always be larger in size then a four bit int column, so my answer would be the better relationship is with the surrogate column.

If that doesn't answer your question, then you need to explain in simple terms with a data example what exactly you are asking, as opposed to simply repeating the question.
I just want to know what is right or appropriate
sql_2012.png
sql_2016.png