This is pursuant to another thread I tried to start, but can't find on
my server.
I've got to store rolling rates of return for investment funds -
calendar year, quarterly, and monthly
To cut to the chase, with a normal data structure, my estimates are
coming out around 20 million recs max.
They'd be indexed on FundID, BeginDate, EndDate, and ReturnType
(Monthly or Quarterly).
Seems to me like I read somewhere that when indexing is used, the
number of records isn't all that big a performance factor.
Can anybody agree or disagree with this?
My alternative is a Pivot Table strategy
For annual returns, we'd have a record for Fund/Year" and 9
RateOfReturn columns - one for each of the rolling periods we need:
- This year and last year
- This year and the previous 2 years
- This year and the previous 3 years
- This year and the previous 4 years
- This year and the previous 5 years
- This year and the previous 6 years
- This year and the previous 7 years
- This year and the previous 8 years
- This year and the previous 9 years
For quarterlies, we'd have a record for each Fund/Year/Quarter and 10
rate of return columns:
- Current quarter back 4 quarters
- Current quarter back 8 quarters
- Current quarter back 12 quarters
- Current quarter back 16 quarters
- Current quarter back 20 quarters
- Current quarter back 24 quarters
- Current quarter back 28 quarters
- Current quarter back 32 quarters
- Current quarter back 36 quarters
- Current quarter back 40 quarters
For monthlies, we'd have a record for each Fund/Year/Month and 8
columns:
- Previous 3 months
- Previous 6 months
- YTD
- Previous 12 months
- Previous 24 months
- Previous 36 months
- Previous 48 months
- Previous 60 months
This would cut the number of records down by a factor of 8-10, giving
us more like 2 million instead of 20 million records.
But would it be worth the loss in flexability/aesthetics?