Search code examples
databaseindexingdata-structuresradix-tree

Searching strings in an adaptive radix tree


I have been going through the research paper of "The Adaptive Radix Tree: ARTful Indexing for Main-Memory Databases", I had a query on how would you be able to match Strings, with the keys of the node. For example: If I had a word: Iota, which was the primary key(identifier) of one of the tuples in my table. And I had to search it from values starting from A such as Alpha to Zeta. For simplicity, please consider only 10 values: Alpha, Beta, Delta, Gamma, Kappa, Iota, Phi, Psi, Rho, Zeta. How would you go about doing it?

Reference to the Research paper: https://db.in.tum.de/~leis/papers/ART.pdf


Solution

  • To me it looks like the paper just describes a regular Trie structure with different inner node types (containing 4, 16 or 256 entries and requiring a binary search int the smaller cases). The authors also seem to compact chains of single child nodes in some way.

    I don't think it's possible to describe the structure very well with your example keys, as they would have all separate entries on the root node (which would be of type 16 in the article) except for Phi and Psi, where the "P" entry would lead to a 4 node with entries for "h" and "s". All remaining entries would be optimized single node chains.

    Note that in real world cases, there are usually not that many different words compared to heap memory sizes today, so I'd hold off on considering "exotic" data structures until there is a real case that is very likely to profit from this.