Table of Contents
Fetching ...

Parallel Joinable B-Trees in the Fork-Join I/O Model

Michael Goodrich, Yan Gu, Ryuto Kitagawa, Yihan Sun

TL;DR

This work addresses the challenge of high I/O costs in parallel join-based balanced trees by introducing the Fork-Join I/O Model to quantify I/O work and I/O span in asynchronous fork-join environments. It develops a B-tree based framework with new primitives—B-Way-Join, Multi-Split, and Multi-Join—to implement I/O-efficient parallel set operations such as union, and extends to intersection and difference. The key theoretical contributions are provable I/O bounds for unions on two B-trees of sizes $m\le n$, achieving $O\left(m \log_B\left(\frac{n}{m}\right)\right)$ I/O work and $O\left(\log_B m \cdot \log_2 \log_B n + \log_B n\right)$ I/O span, by carefully designing multi-way joins/splits and maintaining spine pointers. These results provide a practical, provable framework for I/O-efficient parallel algorithms on trees, with implications for databases, graph processing, and external-memory parallel computation.

Abstract

Balanced search trees are widely used in computer science to efficiently maintain dynamic ordered data. To support efficient set operations (e.g., union, intersection, difference) using trees, the join-based framework is widely studied. This framework has received particular attention in the parallel setting, and has been shown to be effective in enabling simple and theoretically efficient set operations on trees. Despite the widespread adoption of parallel join-based trees, a major drawback of previous work on such data structures is the inefficiency of their input/output (I/O) access patterns. Some recent work (e.g., C-trees and PaC-trees) focused on more I/O-friendly implementations of these algorithms. Surprisingly, however, there have been no results on bounding the I/O-costs for these algorithms. It remains open whether these algorithms can provide tight, provable guarantees in I/O-costs on trees. This paper studies efficient parallel algorithms for set operations based on search tree algorithms using a join-based framework, with a special focus on achieving I/O efficiency in these algorithms. To better capture the I/O-efficiency in these algorithms in parallel, we introduce a new computational model, Fork-Join I/O Model, to measure the I/O costs in fork-join parallelism. This model measures the total block transfers (I/O work) and their critical path (I/O span). Under this model, we propose our new solution based on B-trees. Our parallel algorithm computes the union, intersection, and difference of two B-trees with $O(m \log_B(n/m))$ I/O work and $O(\log_B m \cdot \log_2 \log_B n + \log_B n)$ I/O span, where $n$ and $m \leq n$ are the sizes of the two trees, and $B$ is the block size.

Parallel Joinable B-Trees in the Fork-Join I/O Model

TL;DR

This work addresses the challenge of high I/O costs in parallel join-based balanced trees by introducing the Fork-Join I/O Model to quantify I/O work and I/O span in asynchronous fork-join environments. It develops a B-tree based framework with new primitives—B-Way-Join, Multi-Split, and Multi-Join—to implement I/O-efficient parallel set operations such as union, and extends to intersection and difference. The key theoretical contributions are provable I/O bounds for unions on two B-trees of sizes , achieving I/O work and I/O span, by carefully designing multi-way joins/splits and maintaining spine pointers. These results provide a practical, provable framework for I/O-efficient parallel algorithms on trees, with implications for databases, graph processing, and external-memory parallel computation.

Abstract

Balanced search trees are widely used in computer science to efficiently maintain dynamic ordered data. To support efficient set operations (e.g., union, intersection, difference) using trees, the join-based framework is widely studied. This framework has received particular attention in the parallel setting, and has been shown to be effective in enabling simple and theoretically efficient set operations on trees. Despite the widespread adoption of parallel join-based trees, a major drawback of previous work on such data structures is the inefficiency of their input/output (I/O) access patterns. Some recent work (e.g., C-trees and PaC-trees) focused on more I/O-friendly implementations of these algorithms. Surprisingly, however, there have been no results on bounding the I/O-costs for these algorithms. It remains open whether these algorithms can provide tight, provable guarantees in I/O-costs on trees. This paper studies efficient parallel algorithms for set operations based on search tree algorithms using a join-based framework, with a special focus on achieving I/O efficiency in these algorithms. To better capture the I/O-efficiency in these algorithms in parallel, we introduce a new computational model, Fork-Join I/O Model, to measure the I/O costs in fork-join parallelism. This model measures the total block transfers (I/O work) and their critical path (I/O span). Under this model, we propose our new solution based on B-trees. Our parallel algorithm computes the union, intersection, and difference of two B-trees with I/O work and I/O span, where and are the sizes of the two trees, and is the block size.
Paper Structure (23 sections, 22 theorems, 5 figures, 8 algorithms)

This paper contains 23 sections, 22 theorems, 5 figures, 8 algorithms.

Key Result

Theorem 1.1

Given two B-trees with sizes $m$ and $n\ge m$, there exists a parallel algorithm that returns a new B-tree containing the union of the two input trees in and $O\mathopen{}\mathclose{\left(m\log_B\mathopen{}\mathclose{\left(\frac{n}{m}\right)\right)$ I/O work, $O(\log_B m \cdot \log_2 \log_B n +\log_

Figures (5)

  • Figure 1: Illustration for Join and Split algorithms on binary trees, and an example of the set union algorithm. To extend the idea to B-trees, multi-way Join and Split algorithms are needed.
  • Figure 2: An illustration of the B-Way-Join algorithm (described in \ref{['sec:b-way-join']}) with 6 trees and 5 keys. The blue trees are the tall trees with height $h^*$. All other trees has height less than $h^*$.
  • Figure 3: Above is a B-Tree, where each node rectangle is a node in the B-Tree, whereas the triangles are subtrees shortened for space. There are two search paths to $k_1$ and $k_2$ from the root, sharing the purple path at the start, then separating into the blue and orange paths respectively at node $v.$ All nodes colored blue are the result of following the blue path and copying the appropriate keys, and similarly for the orange nodes. The node containing $k_2$ excludes all keys greater than or equal to $k_2,$ thus being half orange. The result of ${\textsf{Thread-Split}}{}$ will be the union of the blue, orange, and purple nodes. All white sections of the tree will be the search paths of other Thread-Split operations.
  • Figure 4: Trees $T_1, T_2,$ and $T_3$ are all trees of the same height in the same group. $T_1$ fuses with a node in $T,$ but at the same time, $T_2$ is also fusing with the root node of $T_1,$ and $T_3$ is fusing with the root node of $T_2.$ Therefore, there is a dependency where $X$ must fuse with $T_2$ first, then $T_2$ must fuse with $T_1,$ then $T_1$ with $T.$ While $S$ is also fusing with a node in $T_2,$$S$ is fusing with node other than the root of $T_2,$ thus there is no conflict.
  • Figure 5: The B-tree contains 3 nodes $v_1, v_2,$ and $v_3$ which are overloaded. We use the list of pointers in order to construct our arrays $C$. A cell within the array is set to 1 if the node is full or overloaded, i.e. it contains $B$ or more keys. Otherwise, it is set to 0. Note that since $v_1$ only contains a single node above it, its array is also of length 1. Then we take the prefix sum of each array, and mark a node to be divided if $C[i] = i.$ The three colored cells are the nodes which are to be divided. Two of the cells are orange, referring to the same node, meaning the node takes a key from two of its children.

Theorems & Definitions (23)

  • Theorem 1.1: Parallel Set Operations on B-trees
  • Theorem 4.1: B-Way Join Analysis
  • Theorem 1: Multiway Split Cost
  • Lemma 1: Union Algorithm Base Case Cost
  • Lemma 2
  • Lemma 3
  • Theorem 5.1: Parallel Set Operations on B-trees
  • Lemma 4
  • Lemma 5
  • Theorem 6
  • ...and 13 more