Various Links
- Implementation in C, with an accompanying writeup
- Go port of the above (slightly more readable)
- C++ port of the above with some nice refactoring
- Visualization
- Pavlo slides and notes
- Tuple storage
- Detailed Pavlo locking notes from the main memory session
- Wikipedia
- C++ implementation
- Rust stdlib implementation (not a B+ tree, but still has some good Rust tricks)
- Compression
- OLC
- Database Internals implementation notes
- Handling deadlocks with scans, at 54m
- Sibling pointer updates in InnoDB
I think the trick for sibling pointers is:
- Sibling pointer updates always occur between nodes under the same parent
- Moving parents does not require sibling pointer updates
- Just write-lock the node and its left and right neighbors (from left to right) when performing structural modifications
- Index scanners hop only along leaf nodes in either direction, and restart (from their last read key) if they hit a locked node, so while they can block the write, they can’t cause deadlocks, and writes can’t conflict with other writes, since they’re localized to a single parent (and the writer X-locks the parent).
More links: