# "What makes my queries slow?": Subgroup Discovery for SQL Workload Analysis

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

## Key facts

- Cited by 3 papers in the map (data through 14 Oct 2026).
- Builds on 5 of its 44 references that are in the map.
- First posted on arXiv 9 Aug 2021.

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

- [Query2Vec: An Evaluation of NLP Techniques for Generalized Workload Analytics](https://mlsanity.com/paper/1801.05613/) (2018)
- [Comprehensive and Efficient Workload Compression](https://mlsanity.com/paper/2011.05549/) (2020)
- [Anytime Discovery of a Diverse Set of Patterns with Monte Carlo Tree Search](https://mlsanity.com/paper/1609.08827/) (2016)
- [Facilitating SQL Query Composition and Analysis](https://mlsanity.com/paper/2002.09091/) (2020)
- [Query Log Compression for Workload Analytics](https://mlsanity.com/paper/1809.00405/) (2018)

## Built on by (most cited first, 3 of 3)

- [Mining Java Memory Errors using Subjective Interesting Subgroups with Hierarchical Targets](https://mlsanity.com/paper/2310.00781/) (2023)
- [How Can Subgroup Discovery Help AIOps?](https://mlsanity.com/paper/2109.04909/) (2021)
- [Exploiting Formal Concept Analysis for Data Modeling in Data Lakes](https://mlsanity.com/paper/2408.13265/) (2024)

## Abstract (arXiv)

Among daily tasks of database administrators (DBAs), the analysis of query workloads to identify schema issues and improving performances is crucial. Although DBAs can easily pinpoint queries repeatedly causing performance issues, it remains challenging to automatically identify subsets of queries that share some properties only (a pattern) and simultaneously foster some target measures, such as execution time. Patterns are defined on combinations of query clauses, environment variables, database alerts and metrics and help answer questions like what makes SQL queries slow? What makes I/O communications high? Automatically discovering these patterns in a huge search space and providing them as hypotheses for helping to localize issues and root-causes is important in the context of explainable AI. To tackle it, we introduce an original approach rooted on Subgroup Discovery. We show how to instantiate and develop this generic data-mining framework to identify potential causes of SQL workloads issues. We believe that such data-mining technique is not trivial to apply for DBAs. As such, we also provide a visualization tool for interactive knowledge discovery. We analyse a one week workload from hundreds of databases from our company, make both the dataset and source code available, and experimentally show that insightful hypotheses can be discovered.
