I'm setting up a star schema dimensional model.
I have a fact field that is text and can be one of a set of values. Is it better to store it as a text value on the fact table or is it better to store it on the fact table as a 1 digit code and link it to a dimension table that holds the text value?.
The first method avoids a join.
The second makes the fact table smaller.
Consider a simple Order Status field that can be 'Active', 'Cancelled', 'Delivered'. I could record the literal text in the fact table of 'Active', 'Cancelled' or 'Delivered'. I could also store the code value of '1', '2' or '3' and link to a dimension table of 'Active', 'Cancelled' and 'Delivered'.
Is there a best practice for going one way or the other?
Dazed and confused
I have a fact field that is text and can be one of a set of values. Is it better to store it as a text value on the fact table or is it better to store it on the fact table as a 1 digit code and link it to a dimension table that holds the text value?.
The first method avoids a join.
The second makes the fact table smaller.
Consider a simple Order Status field that can be 'Active', 'Cancelled', 'Delivered'. I could record the literal text in the fact table of 'Active', 'Cancelled' or 'Delivered'. I could also store the code value of '1', '2' or '3' and link to a dimension table of 'Active', 'Cancelled' and 'Delivered'.
Is there a best practice for going one way or the other?
Dazed and confused