Table of Contents
Fetching ...

BMTree: Designing, Learning, and Updating Piecewise Space-Filling Curves for Multi-Dimensional Data Indexing

Jiangneng Li, Yuang Liu, Zheng Wang, Gao Cong, Cheng Long, Walid G. Aref, Han Mao Kiah, Bin Cui

TL;DR

This work addresses indexing multi-dimensional data by designing piecewise space-filling curves (SFCs) that adapt to data and workload distributions. It introduces the Bit Merging Tree (BMTree), a binary-tree framework that jointly partitions the space and assigns bit merging patterns (BMPs) to subspaces, with guarantees of injection and monotonicity. A reinforcement-learning approach based on Monte Carlo Tree Search builds BMTree to optimize query performance, using the ScanRange metric as a fast reward proxy. To cope with changing data and query distributions, the paper proposes a partial retraining mechanism guided by distribution-shift scores and optimization potential, achieving substantial performance gains with significantly reduced retraining cost. Extensive experiments in PostgreSQL and RSMI demonstrate BMTree’s superiority over existing SFCs, and the partial retraining approach offers practical, scalable adaptation to shifts in workload and data distribution.

Abstract

Space-filling curves (SFC, for short) have been widely applied to index multi-dimensional data, which first maps the data to one dimension, and then a one-dimensional indexing method, e.g., the B-tree indexes the mapped data. Existing SFCs adopt a single mapping scheme for the whole data space. However, a single mapping scheme often does not perform well on all the data space. In this paper, we propose a new type of SFC called piecewise SFCs that adopts different mapping schemes for different data subspaces. Specifically, we propose a data structure termed the Bit Merging tree (BMTree) that can generate data subspaces and their SFCs simultaneously, and achieve desirable properties of the SFC for the whole data space. Furthermore, we develop a reinforcement learning-based solution to build the BMTree, aiming to achieve excellent query performance. To update the BMTree efficiently when the distributions of data and/or queries change, we develop a new mechanism that achieves fast detection of distribution shifts in data and queries, and enables partial retraining of the BMTree. The retraining mechanism achieves performance enhancement efficiently since it avoids retraining the BMTree from scratch. Extensive experiments show the effectiveness and efficiency of the BMTree with the proposed learning-based methods.

BMTree: Designing, Learning, and Updating Piecewise Space-Filling Curves for Multi-Dimensional Data Indexing

TL;DR

This work addresses indexing multi-dimensional data by designing piecewise space-filling curves (SFCs) that adapt to data and workload distributions. It introduces the Bit Merging Tree (BMTree), a binary-tree framework that jointly partitions the space and assigns bit merging patterns (BMPs) to subspaces, with guarantees of injection and monotonicity. A reinforcement-learning approach based on Monte Carlo Tree Search builds BMTree to optimize query performance, using the ScanRange metric as a fast reward proxy. To cope with changing data and query distributions, the paper proposes a partial retraining mechanism guided by distribution-shift scores and optimization potential, achieving substantial performance gains with significantly reduced retraining cost. Extensive experiments in PostgreSQL and RSMI demonstrate BMTree’s superiority over existing SFCs, and the partial retraining approach offers practical, scalable adaptation to shifts in workload and data distribution.

Abstract

Space-filling curves (SFC, for short) have been widely applied to index multi-dimensional data, which first maps the data to one dimension, and then a one-dimensional indexing method, e.g., the B-tree indexes the mapped data. Existing SFCs adopt a single mapping scheme for the whole data space. However, a single mapping scheme often does not perform well on all the data space. In this paper, we propose a new type of SFC called piecewise SFCs that adopts different mapping schemes for different data subspaces. Specifically, we propose a data structure termed the Bit Merging tree (BMTree) that can generate data subspaces and their SFCs simultaneously, and achieve desirable properties of the SFC for the whole data space. Furthermore, we develop a reinforcement learning-based solution to build the BMTree, aiming to achieve excellent query performance. To update the BMTree efficiently when the distributions of data and/or queries change, we develop a new mechanism that achieves fast detection of distribution shifts in data and queries, and enables partial retraining of the BMTree. The retraining mechanism achieves performance enhancement efficiently since it avoids retraining the BMTree from scratch. Extensive experiments show the effectiveness and efficiency of the BMTree with the proposed learning-based methods.
Paper Structure (29 sections, 1 theorem, 6 equations, 19 figures, 1 table, 2 algorithms)

This paper contains 29 sections, 1 theorem, 6 equations, 19 figures, 1 table, 2 algorithms.

Key Result

Lemma 1

An SFC with a BMP achieves the monotonicity property.

Figures (19)

  • Figure 1: The example illustrates mapping a point using various Bit Merging Patterns (BMP), where each mapping corresponds to a difference SFC. The illustrated BMP mappings are as follows: $\texttt{P}_Z$ ( XYXY) is the BMP of the Z-curve, $\tt XXYY$ is the BMP of the saw-tooth curve (a column-wise scan jagadish1990linear), and $\tt XYYX$ is the third BMP.
  • Figure 2: Motivation for piecewise SFCs, SFC-1 is described by the BMP $\tt XYYX$ while SFC-2 by $\tt XYXY$. In contrast, SFC-3 (ours) is described by two BMPs: left by $\tt XYYX$ and right by $\tt XYYX$, where the green shade highlights the scanned grids.
  • Figure 3: Examples of distribution shifts of both data and query workloads over different subspaces.
  • Figure 4: (a) An example of a piecewise SFC that comprises two BMPs ${\tt P}_1$ and ${\tt P}_2$ for computing values of Data Points $\mathbf{a}$ and $\mathbf{b}$. (b) A BMTree that combines the two BMPs.
  • Figure 5: Workflow of Monte Carlo Tree Search-Based BMTree construction.
  • ...and 14 more figures

Theorems & Definitions (9)

  • Definition 1: Injection
  • Definition 2: Monotonicity
  • Definition 3: Bit Merging Pattern
  • Lemma 1: Monotonicity of SFCs with BMPs
  • Example 1
  • Example 2
  • Example 3
  • Definition 4: Policy Tree
  • Example 4