Abstract
LEA (Learned Encoding Advisor) is a machine-learning-based system designed to automate the selection of data encodings in column-store databases. By leveraging predictive models trained on synthetic data, LEA accounts for both storage efficiency and hardware-specific query latency. Experimental results demonstrate that LEA outperforms traditional heuristic-based advisors, achieving up to 19% lower query latency and a 26% reduction in storage requirements on standard benchmarks like TPC-H.
Introduction
In modern column-store databases, data is organized by column to facilitate high-performance analytical scans and aggressive compression. However, the proliferation of encoding schemes—such as Delta, Dictionary, and Run-Length Encoding (RLE)—presents a complex optimization challenge. Traditional database systems rely on manual heuristics that often prioritize storage size over execution speed and fail to account for the performance characteristics of specific hardware. LEA addresses these flaws by replacing static rules with a suite of learned models that predict the performance of various encodings on the user's actual infrastructure.
System Architecture and Methods
LEA operates through a two-phase process: a training phase using synthetic data and an inference phase for real-world deployment. The system's core innovation lies in its multi-model approach, which predicts three distinct metrics for every encoding type: encoded size, in-memory scan speed, and storage-bound throughput.
During the training phase, LEA generates synthetic datasets to cover a wide range of data distributions. Performance models are trained in situ on the target hardware to capture unique CPU and disk behaviors. In the inference phase, LEA extracts "slice statistics" (such as cardinality and range) and a 1% data sample. These features are processed by Random Forest Regressors and Linear Regression models to recommend the optimal encoding based on the user's specific performance or storage goals.
Key Insights
Research conducted during the development of LEA revealed several critical insights:
- Size vs. Speed: Optimizing solely for storage size—the primary goal of most current heuristics—often results in significant query performance regressions due to high decompression overhead.
- Global Statistics: Predicting the performance of complex encodings like Dictionary or Frame-of-Reference (FOR) requires global data properties (slice statistics) that cannot be captured by small samples alone.
- Synthetic Generalization: Training on diverse synthetic data allows models to generalize effectively to real-world datasets, often outperforming models trained on limited real-world samples.
Evaluation and Results
LEA was integrated into a commercial column-store database ("System C") and evaluated against its native heuristic advisor using the TPC-H and StackOverflow datasets.
The results indicate that LEA provides a superior balance of performance and efficiency. On the TPC-H benchmark, LEA achieved a 19% reduction in query latency while simultaneously using 26% less storage space than the commercial baseline. Furthermore, LEA's recommendations were found to be within 10% of the theoretical optimum determined by exhaustive brute-force testing.
Limitations and Future Work
While LEA represents a significant advancement, several areas for improvement remain. Currently, the system treats all columns with equal priority; incorporating workload awareness to prioritize frequently accessed columns could further enhance performance. Additionally, the authors aim to reduce inference overhead and extend the system to support complex multi-table join operations.
Summary updated