Hi,
I've been at companies that each have a different way of loading type2 dimensions and wanted some guidance on what is the better approach - from a best design practice and performance point of view.
Approach1:
TBL=CUST_ACCOUNT_DIM --> PK(ACC_SK + DIM_TIME_KEY)
Cut new SK only when a new customer account is opened. So, if John Doe already has an existing account# 123, but has changed his address, NO new SK will be generated. What will happen is that a new record will be created to capture his new address with the same SK (123) but with a new TIME_DIM_KEY.
*** What I was never totally sure about is how does this composite PK link/migrate to the fact table?
TBL=CUST_ACCOUNT_DIM --> PK(ACC_SK)
Cut new SK for a)every change to existing accounts and
b)every new account. So in the above example John Doe would get not only a new record inserted, to capture his address change, but would also get a new SK for that record. Also, if a brand new record comes in for Jane Doe (who has no exisating accounts), a new SK will get cut for her.
ANY help on this and an elaboration of the interplay b/w dimensions and facts for these examples would be GREATLY appreciated!
Thanks.
I've been at companies that each have a different way of loading type2 dimensions and wanted some guidance on what is the better approach - from a best design practice and performance point of view.
Approach1:
TBL=CUST_ACCOUNT_DIM --> PK(ACC_SK + DIM_TIME_KEY)
Cut new SK only when a new customer account is opened. So, if John Doe already has an existing account# 123, but has changed his address, NO new SK will be generated. What will happen is that a new record will be created to capture his new address with the same SK (123) but with a new TIME_DIM_KEY.
*** What I was never totally sure about is how does this composite PK link/migrate to the fact table?
TBL=CUST_ACCOUNT_DIM --> PK(ACC_SK)
Cut new SK for a)every change to existing accounts and
b)every new account. So in the above example John Doe would get not only a new record inserted, to capture his address change, but would also get a new SK for that record. Also, if a brand new record comes in for Jane Doe (who has no exisating accounts), a new SK will get cut for her.
ANY help on this and an elaboration of the interplay b/w dimensions and facts for these examples would be GREATLY appreciated!
Thanks.