orientdb
orientdb copied to clipboard
Unification of index implementations
Currently, we have a zoo of data structures which are used for indexes. We have a different kind of tree implementations and also the implementation of extendible hashing. All researchers agree that there is no gain in the usage of hash indexes if you implement B-Tree indexes efficiently using such techniques as data compression and poor-man key in the middle. So that is proposed to implement techniques described in issue #9025 using a tree which has implementation unified for both unique and not unique indexes.
For the unification of implementation of unique and not unique tree-based indexes, we can during insertion convert the key into raw byte array representation for unique index and composition of key + rid for not unique indexes. In the case of the not unique index value of the index will be empty and for the unique index value would be rid part of the entry.
For the implementation of the (not)unique hash index key will consist of hash code and rid of inserted record, and value would contain the key of the inserted record.
Differences between the implementation of indexes are so small that they can be implemented by extension of the class.
Unification of implementation of indexes will allow us to minimize the effort of support and will allow apply modern algorithms in concurrency control and handling of the interaction of indexes with the dis at once for all types of indexes.