ghowlett2020
Programmer
Hi,
Ok so I know generally its not good idea to have a DateTime column as your PK, however for my situation I believe it makes more sense than having a suggogate key in the Fact Table.
The reason are...
1) The data inserted to the fact table is always sequential. I.e. I would never insert date time value that is older than the last value already in Fact table. 2) The data time is not the only column of the PK (composite PK), The PK is of course itself and the dimension FK's surrogate key. 3) The way i be querying the data is nearly always based on time. 4) A surrogate key on the Fact table would tell me nothing about the row. Each row is already unique and to find that particular fact I would always filter on the Date time first and the values in the dimensions. 5) There is no seperate datetime dimension table. No requiremnet now of forseen to have named points in time etc.
Side notes - time will be in UTC and using SQL 2008 R2.
What im asking is giving the situation - what are the disadvantages to doing this? Will I come up against unforseen issues? Is this actaully a good thing to be doing when querying that data basck later?
Would like to know peoples view points on DataTime as first column of a composite PK.
Many Thanks
Gary
Ok so I know generally its not good idea to have a DateTime column as your PK, however for my situation I believe it makes more sense than having a suggogate key in the Fact Table.
The reason are...
1) The data inserted to the fact table is always sequential. I.e. I would never insert date time value that is older than the last value already in Fact table. 2) The data time is not the only column of the PK (composite PK), The PK is of course itself and the dimension FK's surrogate key. 3) The way i be querying the data is nearly always based on time. 4) A surrogate key on the Fact table would tell me nothing about the row. Each row is already unique and to find that particular fact I would always filter on the Date time first and the values in the dimensions. 5) There is no seperate datetime dimension table. No requiremnet now of forseen to have named points in time etc.
Side notes - time will be in UTC and using SQL 2008 R2.
What im asking is giving the situation - what are the disadvantages to doing this? Will I come up against unforseen issues? Is this actaully a good thing to be doing when querying that data basck later?
Would like to know peoples view points on DataTime as first column of a composite PK.
Many Thanks
Gary