I have a service that retrieves data for the following
Func(List<symbols>,List<fields>,StartDate,EndDate)
It will return a 3-dimensional array of values.
Sym1 field1 field2 field3 Sym2 field1 field2 field3 Date1 Date2 Date3
That is, the x axis is fields, the y axis is symbols, and the z axis is dates.
I also have a cache of some of the above values ββ(which I received earlier) in dictionary format
<Date<Symbol<field,value>>>
The service charges money based on each of the data points that it returns. So, if we have 3 characters, 4 fields and 2 data dates, then we will get a fee for 24 points.
I need to break the original large requests into several smaller requests only for data not found in the cache.
Eg. If I have the original query for 5 characters A, B, C, D, E and 4 fields F1, F2, F3, F4 for 3 dates D1, D2, D3.
A,B,C,D,E F1,F2,F3,F4 D1,D2
Assuming the cache already has data for the following fields
B,F2,D2 C,F4,D1
Then the subsequent requests that I will make for maintenance, if they are optimized and broken, will be
Request1 A,B,C,D F1,F3 D1,D2 Request2 A,D F2,F4 D1,D2 Request3 B F2,F4 D1 Request4 B F4 D2 Request5 C F2,F4 D2 Request6 C F2 D1
Is there some standard way to split this into smaller queries / a 3D array. What is the best way to achieve this? What data structure will fit my needs?