RCRank: Multimodal Ranking of Root Causes of Slow Queries in Cloud Database Systems

Biao Ouyang, Yingying Zhang, Hanyin Cheng, Yang Shu, Chenjuan Guo, Bin Yang, Qingsong Wen, Lunting Fan, Christian S. Jensen · DOI

Abstract

Slow queries in cloud databases represent a significant operational challenge. While existing Root Cause Identification (RCI) tools can flag anomalies, they often lack the ability to prioritize fixes based on their actual performance impact. This paper presents RCRank, a multimodal machine learning framework that integrates SQL statements, execution plans, logs, and system metrics. RCRank not only identifies potential root causes but also ranks them by their predicted impact on query execution time, enabling database administrators to focus on the most effective optimizations.

Introduction

Diagnosing slow queries in cloud database systems is a complex task for Database Administrators (DBAs). Traditional Root Cause Identification (RCI) methods typically rely on time-series metrics (KPIs) like CPU or memory usage to detect anomalies. However, these methods face two primary challenges:

  1. Partial Observability: By focusing solely on KPIs, existing tools ignore critical diagnostic data such as SQL query text, execution plans, and detailed logs.
  2. Lack of Impact Ranking: A single performance bottleneck may have multiple contributing factors. Without a way to quantify the "impact"—the potential reduction in execution time if a specific cause is addressed—DBAs may waste resources on low-priority fixes.
RCRank utilizes multimodal data to rank root causes by their performance impact.

Methodology: The RCRank Framework

RCRank addresses these limitations by treating root cause analysis as a multimodal ranking problem. The framework consists of several key components:

Automated Label Generation

To create a ground-truth dataset, the authors developed agents that automatically apply various fixes (e.g., adding indexes, updating statistics) to slow queries. By re-executing these queries and measuring the actual time saved, the system generates precise impact scores for each root cause.

Multimodal Representation Learning

RCRank employs specialized encoders for different data modalities:

  • SQL: Processed using a BERT-based model to capture semantic intent.
  • Execution Plans: Encoded via QueryFormer to understand the graph-based structure of query execution.
  • Logs and KPIs: Handled by MLPs and CNNs, respectively, to capture execution statistics and system-level performance.

Adaptive Cross-Modal Fusion

A core innovation of RCRank is the Adaptive Cross-Modal Transformer (A-CMT). This gating mechanism allows the model to dynamically prioritize features from different modalities based on the suspected root cause. For instance, if a missing index is suspected, the model focuses more on row-count data from logs.

The RCRank pipeline involves training a multimodal diagnosis model on a labeled dataset to perform impact-aware inference.

Evaluation and Results

The framework was evaluated on real-world production data from Alibaba's Hologres system and synthetic benchmarks (TPC-DS, TPC-C, TPC-H) enhanced with LLM-generated complex queries.

Key Performance Metrics

RCRank consistently outperformed baseline models, including LLM-based diagnostic tools like D-Bot. Key findings include:

  • Significant Performance Gains: Applying the top-ranked fix from RCRank reduced query execution times by approximately 30% on real-world datasets and 24-27% on TPC benchmarks.
  • Importance of SQL Modality: Ablation studies showed that raw SQL text is the most informative modality for predicting performance bottlenecks.
  • Effectiveness of Pre-training: Self-supervised cross-modal pre-training significantly improved the model's ability to align disparate data types, leading to higher ranking accuracy.

Discussion and Future Work

RCRank demonstrates that database debugging is a context-dependent process that benefits from an integrated view of multiple data sources. While the current model focuses on internal database factors, future research could expand its scope to include external infrastructure issues. Additionally, moving from individual query optimization to batch-level revision plans remains an open area for exploration.

Conclusion

By shifting the focus from simple identification to impact-aware ranking, RCRank provides a practical and efficient tool for managing cloud database performance. Its multimodal approach and adaptive fusion mechanism mirror the nuanced reasoning of expert DBAs, offering a scalable solution for modern database operations.

Summary updated

BibTeX
@article{ouyang2024rcrank,
  author = {Biao Ouyang and Yingying Zhang and Hanyin Cheng and Yang Shu and Chenjuan Guo and Bin Yang and Qingsong Wen and Lunting Fan and Christian S. Jensen},
  title = {{RCRank: Multimodal Ranking of Root Causes of Slow Queries in Cloud Database Systems}},
  journal = {Proc. VLDB Endow.},
  year = {2024},
  doi = {10.14778/3717755.3717774},
}
Figure