arXiv:2504.19142cs.DBcs.AI2025-04中稿 · ICDE '25被引 1

用强化学习优化批量查询调度,显著缩短任务完成时间。

BQSched: A Non-intrusive Scheduler for Batch Concurrent Queries via Reinforcement Learning

  • 通过注意力机制建模查询特征,结合辅助任务增强的PPO算法提升调度决策能力。
  • 在TPC-DS上平均减少34%总体完成时间,优于传统启发式和现有RL方法。
  • 非侵入式设计,适用于大规模数据和查询场景,适合企业级数据管道优化。

大型企业通常构建预定义的数据流水线,定期运行SQL查询处理运营数据。缩短流水线整体完成时间的关键在于高效调度流水线内的并发查询。现有工具多依赖简单启发式规则,因难以刻画查询间的复杂特征与相互影响。最新的强化学习方法虽具潜力,但受限于庞大的调度空间、高采样成本和低样本利用率,难以直接应用。为此,我们提出BQSched,一种基于强化学习的非侵入式批量查询调度器。BQSched设计了基于注意力的状态表示以捕捉复杂查询模式,并提出IQ-PPO算法,利用日志中单个查询完成信号的丰富信息。在此基础上,BQSched引入三项优化策略:自适应掩码剪枝动作空间、基于调度收益的查询聚类处理大规模查询集,以及增量模拟器降低采样成本。据我们所知,BQSched是首个基于强化学习的非侵入式批量查询调度器。大量实验表明,BQSched能显著提升批量查询调度的效率与稳定性,在数据与查询规模上均表现出优异的可扩展性与适应性。例如,在所有测试数据库系统和规模下,相比常用启发式策略和适配的RL调度器,BQSched在TPC-DS基准上平均将批量查询整体完成时间分别减少34%和13%。

原文摘要 · Abstract (English)

Most large enterprises build predefined data pipelines and execute them periodically to process operational data using SQL queries for various tasks. A key issue in minimizing the overall makespan of these pipelines is the efficient scheduling of concurrent queries within the pipelines. Existing tools mainly rely on simple heuristic rules due to the difficulty of expressing the complex features and mutual influences of queries. The latest reinforcement learning (RL) based methods have the potential to capture these patterns from feedback, but it is non-trivial to apply them directly due to the large scheduling space, high sampling cost, and poor sample utilization. Motivated by these challenges, we propose BQSched, a non-intrusive Scheduler for Batch concurrent Queries via reinforcement learning. Specifically, BQSched designs an attention-based state representation to capture the complex query patterns, and proposes IQ-PPO, an auxiliary task-enhanced proximal policy optimization (PPO) algorithm, to fully exploit the rich signals of Individual Query completion in logs. Based on the RL framework above, BQSched further introduces three optimization strategies, including adaptive masking to prune the action space, scheduling gain-based query clustering to deal with large query sets, and an incremental simulator to reduce sampling cost. To our knowledge, BQSched is the first non-intrusive batch query scheduler via RL. Extensive experiments show that BQSched can significantly improve the efficiency and stability of batch query scheduling, while also achieving remarkable scalability and adaptability in both data and queries. For example, across all DBMSs and scales tested, BQSched reduces the overall makespan of batch queries on TPC-DS benchmark by an average of 34% and 13%, compared with the commonly used heuristic strategy and the adapted RL-based scheduler, respectively.

查询调度强化学习大数据性能优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。