Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Taurkon
Starting Member
26 Posts |
Posted - 2007-03-21 : 09:29:15
|
I have a table with a primary key consisting of:ExampleKeyID1 PKKeyID2 PKKeyID3 PKand 15 fact attributes, but for this example, lets just use 4:AMT1AMT2AMT3AMT4There are 3 tables joined to this table against the primary key attributes (the dimensions), AND the user will often, but not always select all the fact attributes when viewing the cube in AS. In essence, the result returned by the cube will be the sum of all AMT's grouped by dimensions.How would one index for this? Separate indexes on each AMT or a clustered index on all AMT's?Thanks in advance |
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2007-03-21 : 11:27:29
|
You seem to have things the wrong way round. The fact table needs to have foreign key values and the dimensions have the primary keys.For example in a fact table you'd have a CustomerID and a RegionID that are foreign keys to the Customer and Region tables where the Customer and Region primary keys are defined. Many rows in the fact table will relate to a single row in the dimension table. Given the names you used of AMTx, I'm guessing that the fact attributes you referred to are values? If so then they shouldn't need to be indexed, because you aren't going to query on them, you're going to query on the dimensions. |
 |
|
|
|
|