Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

Should my dimension table be this big? Expand / Collapse
Author
Message
Posted Monday, June 30, 2014 5:04 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Yesterday @ 3:34 AM
Points: 78, Visits: 450
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
Post #1587583
Posted Monday, June 30, 2014 5:38 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 11:32 PM
Points: 13,017, Visits: 10,801
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?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1587587
Posted Monday, June 30, 2014 5:44 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Yesterday @ 3:34 AM
Points: 78, Visits: 450
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.
Post #1587590
Posted Monday, June 30, 2014 6:32 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 11:32 PM
Points: 13,017, Visits: 10,801
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?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1587608
Posted Monday, June 30, 2014 6:37 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Yesterday @ 3:34 AM
Points: 78, Visits: 450
Excellent, back on track now

Cheers
Post #1587610
Posted Monday, June 30, 2014 8:46 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Yesterday @ 3:34 AM
Points: 78, Visits: 450
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?
Post #1587674
Posted Monday, June 30, 2014 2:00 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 11:32 PM
Points: 13,017, Visits: 10,801
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?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1587771
Posted Monday, June 30, 2014 3:30 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Yesterday @ 3:34 AM
Points: 78, Visits: 450
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?
Post #1587807
Posted Monday, June 30, 2014 3:49 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 11:32 PM
Points: 13,017, Visits: 10,801
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?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #1587812
Posted Monday, June 30, 2014 3:55 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Yesterday @ 3:34 AM
Points: 78, Visits: 450
ok Koen, ill investigate further, thanks for the help mate..
Post #1587814
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse