[Newbies] Best data structure for a multidimensional database?

stan shepherd squeak414 at free.fr
Tue Oct 7 15:38:42 UTC 2008


Hi, I'm looking at building a small proof of concept of a multidimensional
modelling tool in Squeak. Commercial products are things like Cognos, and
the old Express that was assimilated by Oracle.

A typical 'cube' will be 'dimensioned' by product, region, time. Each
dimension has one or more roll-ups, e.g.

                                             All Ice Creams

                                        /                      \
                              Cornetto                             Tub

                        /             |                 \  
               C. Raspberry   C. Vanilla      C. Chocolate


Then sales data would be entered for the lowest level, then rolled up over
the product hierarchy, the region hierarchy, the time hierarchy.

>From there, you can ask qusetions like "what's the year on year change in
sales of Cornetto for Western Europe".

Two data structures spring to mind: 

1) Use nested dictionaries for the dimensions, so that from the sales cube
we select the dictionary entry for Cornetto, then from there the entry for
Western Europe, then the two entries for this year to date and last year to
date, being actual numbers.
2) Give each dimension element a numerical index, eg Cornetto is product no
451 in the product dimension. Sales then becomes a single dictionary where
we calculate the index as product number + (region number * number of
products) + (period number * number of products * number of regions)

no 2) sounds faster, but no 1) sounds Squeakier. Does anyone have any advice
as to how best to do this?

Options 3) etc also welcome.

I daresay the correct answer is to do both and see which works best, but I
suspect there are some obvious gotchas I'm not seeing.

Thanks,   Stan


-- 
View this message in context: http://www.nabble.com/Best-data-structure-for-a-multidimensional-database--tp19860963p19860963.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.



More information about the Beginners mailing list