We get a lot of questions about how Fractal Tree indexes work. It’s a write-optimized index with fast queries, but which write-optimized indexing structure is it?

In this ~15 minute video (which uses these slides), I give a quick overview of how they work and what they are good for.

7 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
alphazero

(That isn’t really a “fractal”.)

It would be good to include ‘cons’ at the last slide. For example, given that you are (effectively) caching a sub-set of your index (“buffer”), it would be good to discuss the D of ACID guarantees in context of server crashes

Tianshi

I am wondering how the secondary index work? Eventually the data on disk can only be ordered by PK. Innodb secondary indexes use another btree to store PK. How does TokuDB implement the secondary key?

Thanks!

Shashank

What about this is “fractal”? I mean, it seems like all you are doing is adding buffering at non-leaf nodes of a B tree index.

Martin Farach-Colton

Hi Shashank,

In a Fractal Tree index, each buffer (at an internal node) is recursively indexed. Furthermore, the leaves have an indexed structure (see this post for a discussion of Basement Nodes). So it’s not “fractal” in the sense of self-similarity at all levels, but we do have two different levels of indexing. Historically, we considered several other designs for the TokuDB data structure. Most of these were more “fractal” in that they were Cache Oblivious (CO). A CO data structure optimizes simultaneously for any possible parameter choice in the memory system, and thus optimizes at every level of the memory system. They are self-similar at many levels. So the use of “fractal” at this point is partly historical, and the remnant of this history is visible in the two levels of indexing. In short, it’s a marketing term.

Ansarul

What are the read performance in case of Fractal Tree Indexing