B-Tree Read Iterator Pre-fetching Leaf Nodes
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
B-trees face inefficiencies in data retrieval due to the need to traverse parent or grandparent nodes to determine storage locations of next leaf nodes, leading to increased compute cycles and latency, particularly when accessing disk storage.
Innovation Solution
Implementing a 'point B-tree' with pointers at the end of each leaf node to directly access the next leaf node, and using a 'bulk-loaded B-tree' structure where data is stored in sequential pages to optimize disk access, along with a read iterator object that pre-fetches nodes into memory to reduce repeated disk access.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of time
If traditional B-tree traversal is used to determine storage locations of leaf nodes, then data structure simplicity is maintained, but access latency increases and compute cycles increase
Solution Approach 1:
The patent applies preliminary action by pre-calculating and storing pointer values in each leaf node that directly indicate the storage locations of subsequent leaf nodes. This allows the system to bypass intermediate parent node traversals and directly access the next required data, thereby reducing access latency without significantly increasing overall data structure complexity
Solution Approach 2:
The patent introduces pointers as intermediary elements within leaf nodes that mediate between the current leaf node and the next leaf node's storage location. These pointers act as direct references that eliminate the need for traversing up the tree to parent nodes and back down, thus reducing both access latency and compute cycles while maintaining the fundamental B-tree structure
2Productivity
If sequential disk access is used for B-tree nodes, then data retrieval is straightforward, but disk I/O performance deteriorates
Solution Approach 1:
The patent applies preliminary action by pre-fetching subsequent leaf nodes into memory before they are actually needed for processing. The read iterator object anticipates future access patterns and loads data in advance, reducing the frequency of disk I/O operations and improving overall data retrieval productivity while lowering disk access energy consumption
3Productivity
If parent node traversal is performed to find next leaf node location, then data structure consistency is maintained, but compute cycles increase
Solution Approach 1:
The patent extracts the traversal operation from the data access path by storing direct pointer references within leaf nodes. Instead of requiring traversal up to parent nodes and back down to locate the next leaf node, the pointer values are extracted and stored directly in the leaf node structure, enabling immediate direct access to subsequent leaf nodes and significantly reducing compute cycles while maintaining data structure consistency
Data Source
AI summary
Embodiments described herein are related to a method of scanning a B-tree. For example, a method comprises receiving a scan request to scan a B-tree having a plurality of levels, each level comprising one or more nodes, wherein for each of one or more levels of the plurality of levels, nodes are grouped into groups, where nodes of any given group are stored across sequential disk blocks. The method further comprises generating a queue for each level of the B-tree. For each queue, the method further comprises loading into memory a next group of nodes based upon determining a storage location of a node of the next group of nodes.


