Optimize indexing and querying for fast performance. Currently search is fast as all data structures are stored in memory. This task will be relevant when other types of storage are enabled.