![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, just one question about the AdventureWorksDB sample database: Why are there "artificial" primary keys such as TimeKey and AccountKey which start from 1? Is there any reason not to use the date, for example 1/1/2004, or the specific account number, as primary key? TimeKey FullDateAlternateKey DayNumberOfWeek 915 1/1/2004 5 916 1/2/2004 6 917 1/3/2004 7 918 1/4/2004 1 Thanks. Mark |
#3
| |||
| |||
|
|
they use identify columns. So the counter starts at 1. in a standard DW system generally we use an integer instead of a date/time for the time dimension for performance reason. for other dimensions, using a surrogatekey give some advantages. Specially if your source system use characters has a key. Also, surrogatekeys allow you to load data from multiple sources where you'll have the same account number, using surrogate keys you can create 2 keys (1 by source). again, using integer improve performance and storage. when you have only 1 source where the codes are integers and you don't have slow changing dimensions, then you can use the source key instead of a surrogate key. remember the adv. works is a sample based on standard best practices for a DW structure. "Mark" <mfrohgast (AT) yahoo (DOT) de> wrote in message news:OwBPMYTKHHA.1280 (AT) TK2MSFTNGP04 (DOT) phx.gbl... Hello, just one question about the AdventureWorksDB sample database: Why are there "artificial" primary keys such as TimeKey and AccountKey which start from 1? Is there any reason not to use the date, for example 1/1/2004, or the specific account number, as primary key? TimeKey FullDateAlternateKey DayNumberOfWeek 915 1/1/2004 5 916 1/2/2004 6 917 1/3/2004 7 918 1/4/2004 1 Thanks. Mark |
![]() |
| Thread Tools | |
| Display Modes | |
| |