I want to store objects indexed by a 3-tuple of (String, String , DateTime). Lets call these Identifier,Category,Day
Any object in the data structure is guaranteed to be unique by the 3-tuple (no duplicates)
The data structure should support fast answers to questions such as:
- What are all the unique identifiers?
- What are the categories for identiifer "xyz"?
- What are the days where identifier = "xyz" and category is "mycategory"?
Removal is also possible. Would be great to maintain a low memory profile.
As a baseline, I'm using Dictionary<string , Dictionary<string , Dictionary<DateTime , object>>>
Theoretically this should give me O(1) retrieval, but I'm not familiar with the internals of Dictionary and generally I have a feeling that my solution is sub-optimal.
I know there's probably no one right answer here and I could provide numerous usage details, but perhaps someone can just give me a few ideas to play with?
Edit
The only retrieval performed is with equality (i.e. identiifer = "xyz"). I don't use inequalities (greater-than, less-than, etc.)