Table of Contents
Fetching ...

Cost-based Selection of Provenance Sketches for Data Skipping

Ziyu Liu, Boris Glavic

TL;DR

The paper tackles the challenge of selecting effective provenance sketches to accelerate data-skipping in provenance-based data skipping (PBDS). It introduces a sample-based size estimation framework rooted in approximate query processing to predict the footprint of sketches built on candidate range-partition attributes, enabling principled, cost-based sketch selection. By combining safety checks, stratified sampling, bootstrap-based confidence intervals, and multiple candidate-attribute strategies, the approach consistently ranks and selects sketches that minimize data coverage while preserving query correctness. Implemented within a PBDS prototype on PostgreSQL, the method yields accurate size estimates and near-optimal sketch choices, achieving substantial runtime improvements (up to 60%) across diverse workloads and datasets. The results demonstrate the practicality of online sketch selection and provide a roadmap for scalable PBDS deployment in real-world DBMSs.

Abstract

Provenance sketches, light-weight indexes that record what data is needed (is relevant) for answering a query, can significantly improve performance of important classes of queries (e.g., HAVING and top-k queries). Given a horizontal partition of a table, a provenance sketch for a query Q records which fragments contain provenance. Once a provenance sketch has been captured for a query, it can be used to speed-up subsequent queries by skipping data that does not belong to a sketch. The size and, thus, also the effectiveness of a provenance sketch is often quite sensitive to the choice of attribute(s) we are partitioning on. In this work, we develop sample-based estimation techniques for the size of provenance sketches akin to a specialized form of approximate query processing. This technique enables the online selection of provenance sketches by estimating the size of sketches for a set of candidate attributes and then creating the sketch that is estimated to yield the largest benefit. We demonstrate experimentally that our estimation is accurate enough to select optimal or near optimal provenance sketches in most cases which in turn leads to a runtime improvement of up to %60 compared to other strategies for selecting provenance sketches.

Cost-based Selection of Provenance Sketches for Data Skipping

TL;DR

The paper tackles the challenge of selecting effective provenance sketches to accelerate data-skipping in provenance-based data skipping (PBDS). It introduces a sample-based size estimation framework rooted in approximate query processing to predict the footprint of sketches built on candidate range-partition attributes, enabling principled, cost-based sketch selection. By combining safety checks, stratified sampling, bootstrap-based confidence intervals, and multiple candidate-attribute strategies, the approach consistently ranks and selects sketches that minimize data coverage while preserving query correctness. Implemented within a PBDS prototype on PostgreSQL, the method yields accurate size estimates and near-optimal sketch choices, achieving substantial runtime improvements (up to 60%) across diverse workloads and datasets. The results demonstrate the practicality of online sketch selection and provide a roadmap for scalable PBDS deployment in real-world DBMSs.

Abstract

Provenance sketches, light-weight indexes that record what data is needed (is relevant) for answering a query, can significantly improve performance of important classes of queries (e.g., HAVING and top-k queries). Given a horizontal partition of a table, a provenance sketch for a query Q records which fragments contain provenance. Once a provenance sketch has been captured for a query, it can be used to speed-up subsequent queries by skipping data that does not belong to a sketch. The size and, thus, also the effectiveness of a provenance sketch is often quite sensitive to the choice of attribute(s) we are partitioning on. In this work, we develop sample-based estimation techniques for the size of provenance sketches akin to a specialized form of approximate query processing. This technique enables the online selection of provenance sketches by estimating the size of sketches for a set of candidate attributes and then creating the sketch that is estimated to yield the largest benefit. We demonstrate experimentally that our estimation is accurate enough to select optimal or near optimal provenance sketches in most cases which in turn leads to a runtime improvement of up to %60 compared to other strategies for selecting provenance sketches.
Paper Structure (47 sections, 20 equations, 9 figures, 1 table, 2 algorithms)

This paper contains 47 sections, 20 equations, 9 figures, 1 table, 2 algorithms.

Figures (9)

  • Figure 1: Running example illustrating the importance of choosing the right attribute to build a provenance sketches on.
  • Figure 2: Relational Algebra
  • Figure 3: Workflow of cost model
  • Figure 4: Relative sketch data size error varying times of resamples over TPCH
  • Figure 5: Example for Stratified Sampling on Group-by Attributes
  • ...and 4 more figures

Theorems & Definitions (10)

  • Example 1
  • Definition 1: Sufficient Input
  • Definition 2: Range partition
  • Definition 3: Provenance Sketch
  • Definition 4: Safety
  • Definition 5: Attribute Safety
  • Definition 6: Stratified samples
  • Definition 7: Approximating results rules
  • Definition 8: Size estimation rules
  • Definition 9: Selectivity Expectation