# Data Provenance Aggregation and Structural Descriptors for Query-Template Identification

arXiv: https://arxiv.org/abs/2610.22705 · HTML: https://mlsanity.com/paper/2610.22705/

## Key facts

- No citing papers in the map yet (data through 26 Nov 2026).
- Builds on 5 of its 32 references that are in the map.
- Submitted 15 Oct 2026.

## Builds on (most cited first, 5 of 5)

- [Comprehensive and Efficient Workload Compression](https://mlsanity.com/paper/2011.05549/) (2020)
- [Database Workload Characterization with Query Plan Encoders](https://mlsanity.com/paper/2105.12287/) (2021)
- [On Optimizing the Trade-off between Privacy and Utility in Data Provenance](https://mlsanity.com/paper/2103.00288/) (2021)
- [Towards Inferring Queries from Simple and Partial Provenance Examples](https://mlsanity.com/paper/2008.08989/) (2020)
- [A DBMS-independent approach for capturing provenance polynomials through query rewriting](https://mlsanity.com/paper/2508.14608/) (2025)

## Abstract (arXiv)

Runtime query similarity identification supports several activities, including workload analysis, identifying recurring behaviour, auditing, debugging, and anomaly detection. Existing methods for evaluating query similarity mostly rely on SQL text, execution plans, or result values but do not account for input data or how results are derived during query execution. This paper proposes a novel approach using data provenance for query-template identification. We construct query-level profiles that capture explicit data dependencies, occurrence frequencies, and structural properties by aggregating tuple-level Lineage and Why-provenance across entire query results. We also derive Provenance Structural Descriptors (PSD), which summarise these profiles using a small set of numerical features. We evaluate our proposals using these profiles to identify query templates over (12,500) distinct query instances generated from parametrised TPC-DS query templates. The experimental evaluation shows that query templates can be identified solely from their provenance footprints, and that accuracy improves as more historical data becomes available. It also shows that PSD achieve high classification accuracy with limited training history and low test-processing cost.
