SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Should my dimension table be this big?


Should my dimension table be this big?

Author
Message
ps_vbdev
ps_vbdev
Old Hand
Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)

Group: General Forum Members
Points: 391 Visits: 712
Im in the process of building my first product dimension for a star schema and not sure if im doing this correctly. A brief explanation of our setup

We have products (dresses) made by designers for specific collections each of which has a range of colors and each color can come in many sizes. For our UK market this equates to some 1.9 million product variants. Flattening the structure out to Product+designer+collection gives about 33,000 records but when you add all the colors and then all the colors sizes it pumps that figure up to 1.9million. My “rolled own” incremental ETL load runs ok just now, but we are expanding into the US market and our projections indicate that our products variants could multiple 10 fold. Im a bit worried about performance of the ETL just now and in the future.

1) Is 1.9m records not an awful lot of records to incrementally load (well analyse) for a dimension table nightly as it is never mind what that figure may grow to when we go to US?
2) I thought of somehow reducing this by using a snowflake but would this not just reduce the number of columns in the dimensions and not the row count?
3) I then thought of separating the colors and size into their own dimension, but this doesn’t seem right as they are attributes of products and also I would lose the relationship between products, size & color I.e. I would have to go through the fact table (which ive read is not a good choice.) for any analysis.

Am I correct in thinking these are big numbers for a dimension table? Is it even possible to reduce the number somhow?

Still learning so welcome any help.

Thanks
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28087 Visits: 13268
1. Yes, 1,9M rows is quite a lot for a dimension table (especially if you are going tenfold in the US). If you are going to use SCD type 2, this can get even worse.
2. Snowflaking will not help, as you already concluded.
3. This type of modelling is actually not that uncommon and is called mini-dimensions. They are well documented by Kimball and can reduce the complexity of your set-up enormously.

However, as you already mentioned - the link between the actual dimension and the mini dimension is through the fact table.
This can lead to other issues, such as dresses that have not sold anything. How can you analyze on dresses that have not sold a single piece, because there is not a transaction?
As mentioned in the article I linked to, you can create a factless fact table or something similar to track all the possible products.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
ps_vbdev
ps_vbdev
Old Hand
Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)

Group: General Forum Members
Points: 391 Visits: 712
Thanks Koen

I was actual reading about these but was not sure if i was on the correct path. In my case would i have a product dimension of granularity Product+designer+collection and then a minidimension holding all the possibly combinations of size and color? what if these combinations change frequently ie. size can be added and removed from color. i guess these would need to be calculated nightly also.
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28087 Visits: 13268
ps_vbdev (6/30/2014)
Thanks Koen

I was actual reading about these but was not sure if i was on the correct path. In my case would i have a product dimension of granularity Product+designer+collection and then a minidimension holding all the possibly combinations of size and color? what if these combinations change frequently ie. size can be added and removed from color. i guess these would need to be calculated nightly also.


Yes and yes.
If you want to do product analyses (not linked to sales/productions/...), then you need to create a factless fact table that just lists all possible combinations.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
ps_vbdev
ps_vbdev
Old Hand
Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)

Group: General Forum Members
Points: 391 Visits: 712
Excellent, back on track now :-)

Cheers
ps_vbdev
ps_vbdev
Old Hand
Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)

Group: General Forum Members
Points: 391 Visits: 712
Additionally

If i have one mini-dimension for both color and size this would still give about 5million combinations so could i split this further down to having two mini-dimensions, one for size and one for color feeding into the fact table. otherwise its just sort of moving the problem isnt it?
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28087 Visits: 13268
ps_vbdev (6/30/2014)
Additionally

If i have one mini-dimension for both color and size this would still give about 5million combinations so could i split this further down to having two mini-dimensions, one for size and one for color feeding into the fact table. otherwise its just sort of moving the problem isnt it?


5 million combinations for sizes and colors? How many colors and sizes are there?


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
ps_vbdev
ps_vbdev
Old Hand
Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)

Group: General Forum Members
Points: 391 Visits: 712
I know, i know its crazy, the problem is the colors relay. you see designers have always been allowed to set up there own products so when they are setting up each product the can enter there own flavor of black or they can can get really creative with colors like "Firecracker" or "Valentine".

so there are multiple black, reds, blues etc ontop

the sizes are similar but not as bad but i have seen things like "Up to 6 months" or "5 year old" for childs clothing.

If i group the sizes i can get the 300,000 down to 1000, with the colors 400,00 down to 5000ish but not sure how feasible this would be. Im investigating getting this changed and controlling the color and size creation at our end but this is what ive inherited.

from a knowledge point of view though is it possible to have two or more mini dimension in r.e. my last post?
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28087 Visits: 13268
ps_vbdev (6/30/2014)

from a knowledge point of view though is it possible to have two or more mini dimension in r.e. my last post?


It is possible, sure.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
ps_vbdev
ps_vbdev
Old Hand
Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)Old Hand (391 reputation)

Group: General Forum Members
Points: 391 Visits: 712
ok Koen, ill investigate further, thanks for the help mate..
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search