cs.DBOct 15, 2026

Data Provenance Aggregation and Structural Descriptors for Query-Template Identification

Authors: Paulo Pintor, Rogério Costa, José Moreira

Organizations: IEETA, University of Aveiro, Aveiro, Portugal . · CISUC, DEI, University of Coimbra, Coimbra, Portugal .

Abstract

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,50012{,}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.

Figures & tables

Explore similar work

CardsList
  1. BIRD-History: A Benchmark for History-Driven Text-to-SQL with Fine-Grained Knowledge Annotations

    Aug 29, 2026Yunfan Zhou, Qiming Shi, Yizhou Yang +2Text-to-SQLText-to-SQL Evaluation

  2. Schema-Free Text-to-SQL: Learning Enterprise Database Structure from Query Logs

    Oct 24, 2026Ömer Faruk Akgül, Nikhil Kapahi, Prajit Reddy MuppidiText-to-SQLGraph Retrieval-Augmented Generation