My record structure is as below:- (Name,Option,StartNum,EndNum,Vacancy)
Name,Option,StartNum,EndNum form the composite keys of the sturcture/table. So for a given combination of these, there would be only one Vacancy record.
Sample Records
ABC,X,2,14,1
ADE,X,3,8,0
AEF,Y,1,12,2
ERF,X,12,13,17
There could be:
250-300 Names
For each Name 20-30 Options
For each Option 1-45 StartNum
For each StartNum 1-14 EndNum
For each combination of above entries, there would be only one entry for Vacancy.
So there could be maximum of 5,670,000 (300*30*45*14) entries
Fast operations to support
- Search on the composite key i.e. (Name+Option+StartNum+EndNum) and fetch it's Vacancy record value
- For a given Name,Option and a Number, search and delete records having the given Name,Option and StartNum<=Number<=EndNum
Can anyone please suggest the appropriate datastructure for my above requirement. The data structure building operation can be slow as its done offline, but the above mentioned two operations should be very very fast.
Thanks,
Harish