February 12, 2010 at 2:41 am
I had a discussion about choosing between one vertical table with the following structure
ColumnId INT
ColumnName VARCHAR,
NColumnValue DECIMAL,
CColumnValue VARCHAR
versus multiple horizontal tables with the following structure: The horizontal table will have approx 60 fields each.
ColumnId INT,
Column1 DECIMAL,
Column2 DECIMAL,
Column3 VARCHAR,.....
What are the advantages and disadvantages in terms of performance of horizontal table versus a vertical table?
February 12, 2010 at 3:21 am
There's a lot to say and write about this. Which one is best for you largely depends on how you are going to use it. So you may want to elaborate a bit on that before we start throwing our suggestions at you.
From my personal experience: I'm a data warehouse guy and most of the time we use the column based approach. However, there are times when we have a large number of columns but only a few will be filled at a time. On this occasion, we sometimes switch to the row based approach, creating what is called a 'measure dimension'.
You should also note that it is always possible to move from one to the other as no information is lost in the transformation. The implications of this switch for your application on the other hand, can be quite invasive...
February 12, 2010 at 2:05 pm
Thanks Willem.
The tables will store historical financial statement data. Some data manipulation might be involved (i.e. SUM, AVG, etc). The front end app will mainly be a consumer. Let me know if I need to elaborate more.
February 12, 2010 at 5:18 pm
In the horizontal model, what will the columns represent?
--Jeff Moden
Change is inevitable... Change for the better is not.
March 4, 2010 at 10:38 pm
The fields will be id - year - revenue - net income - income tax - earnings before tax - etc
March 5, 2010 at 12:04 am
March 5, 2010 at 5:55 am
chidev (3/4/2010)
The fields will be id - year - revenue - net income - income tax - earnings before tax - etc
If it's truely and only for historical lookups and the underlying data will never be modified, that could work. The only problem I foresee is if you need to add an attribute... rows previous to that need will necessarily contain nulls.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply