Expeditus: Database Optimization Based on Workload Analysis with Structural Query Clustering - Duarte, Marlon Gonçalves; Marinho, Júlio César de Lira; Brayner, Ângelo Rocalli Alencar; Franco, Wellington (Anais do Simpósio Brasileiro de Banco de Dados (SBBD); 2026: Anais do XLI Simpósio Brasileiro de Bancos de Dados, 2026)
Workload analysis is fundamental to database performance management, as heterogeneous and complex workloads require automated identification of similar query patterns. In this context, this work investigates whether SQL query clustering based on structural embeddings extracted from the workload can support more efficient database tuning strategies. As an experimental foundation, we employ the TPC-H benchmark, whose queries were transformed into vector representations using the Qwen3-Embedding-0.6B model. After dimensionality reduction with UMAP, we applied the HDBSCAN algorithm to identify structurally coherent query clusters. We then evaluated whether indexes derived from a representative query within each cluster could improve the performance of the remaining queries in the same group. The experiments resulted in seven structurally cohesive clusters, demonstrating the model’s ability to capture structural similarities across distinct queries. The results indicate that optimizing a single query can benefit other queries within the same cluster, supporting the use of structure-driven tuning strategies for complex database workloads.