Exploring Query Results

Murali Mani, Zhenyan LiuarXiv 2019

Introduction

In modern data-driven environments, users frequently interact with large-scale databases to derive insights. However, receiving a final result is often only the first step. To verify findings or investigate anomalies, users need to "drill down" into specific results to understand their origin—a process known as retrieving database provenance. This paper addresses the computational bottlenecks associated with provenance retrieval, proposing a system that enables real-time exploration without sacrificing initial query performance.

The Challenge of Provenance

Provenance, or lineage, identifies the specific source rows that contributed to a query result. For instance, in a sales report, a manager might want to see the individual line items that comprise a specific total. Traditionally, systems handle this in one of two ways:

  1. Lazy Approaches: These re-compute the lineage upon request by re-executing complex joins. While this keeps the initial query fast, the exploration phase becomes sluggish.
  2. Eager Approaches: These record all lineage data during the initial query execution. This ensures fast retrieval but imposes a massive performance penalty and storage overhead on the primary database operations.
Figure 1: The workflow of query result exploration, from data gathering to user-driven result analysis.

The goal of this research is to bridge these extremes, providing a "hybrid" solution that is both efficient to compute and fast to query.

Methodology

The authors introduce two core innovations to optimize the provenance pipeline: constraint-based pruning and selective materialization.

Constraint-Based Pruning

The researchers observed that query results often contain attributes, such as primary keys, that uniquely identify source data. By leveraging functional dependencies—rules defining how data fields relate—they developed an algorithm to simplify provenance queries. If a result table already contains a unique identifier for a source table, the system can skip expensive multi-table joins and look up the source row directly. This "lazy" optimization significantly reduces the computational load during exploration.

Figure 5: Example source tables (Customers, Orders, Lineitem) used to demonstrate join relationships and provenance.

Selective "Hybrid" Materialization (O2)

To further enhance performance, the paper proposes the O2 strategy. Instead of storing all lineage data (eager) or none (lazy), the system identifies "bridge" keys—identifiers that are difficult to recover after the initial join. These keys are stored in an augmented result table. A cost-benefit model determines which keys are worth the extra storage based on their predicted impact on future exploration speed.

Experimental Evaluation

The proposed methods were evaluated using the industry-standard TPC-H benchmark on a 1GB dataset. The testing environment utilized PostgreSQL 10 on a server with 128GB of RAM, covering 19 of the 22 TPC-H queries.

Key Findings

  • Optimization Impact: The join-minimization logic was applicable to approximately 37% of the TPC-H queries, demonstrating its relevance to real-world relational schemas.
  • Performance Gains: The optimized lazy algorithm (O1) showed dramatic improvements over standard methods. For TPC-H Query 18, retrieving customer provenance took only 0.07ms with O1, compared to 1522.44ms with the baseline—a speedup of over 20,000x.
  • Initial Query Overhead: The hybrid approach (O2) successfully avoided the "eager penalty." While a full eager approach took nearly 5,700 seconds for Query 18, the O2 approach completed the initial query in just 13 seconds while maintaining near-instant provenance retrieval.

Conclusion and Future Work

This research demonstrates that leveraging database constraints and selective materialization can make provenance retrieval viable for real-time interactive exploration. While currently focused on Aggregate-Select-Project-Join (ASPJ) queries under set semantics, future work aims to extend these optimizations to more complex query types, including outer joins and unions, and to explore "how-provenance" to provide even deeper insights into data derivation.

Summary updated

BibTeX
@misc{mani2019exploring,
  author = {Murali Mani and Zhenyan Liu},
  title = {{Exploring Query Results}},
  year = {2019},
  eprint = {1905.09251},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.09251},
}
Figure