arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2504.19142cs.DBcs.AI
收藏

BQSched:基于强化学习的批量并发查询非侵入式调度器

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

Key Laboratory of High Confidence Software Technologies, CS, Peking University(高可信软件技术重点实验室,北京大学);Simon Fraser University(西蒙·弗雷泽大学);Huawei Cloud(华为云)

Chenhao Xu, Chunyu Chen, Jinglin Peng, Jiannan Wang, Jun Gao

AI总结:

本文提出BQSched,首个基于强化学习的非侵入式批量查询调度器,通过注意力状态表示、IQ-PPO算法及三种优化策略显著提升了调度效率与稳定性。

摘要:

大多数大型企业构建预定义的数据管道并定期执行它们,以使用SQL查询处理各种任务的操作数据。最小化这些管道整体完成时间的一个关键问题是管道内并发查询的高效调度。由于难以表达查询的复杂特征和相互影响,现有工具主要依赖简单的启发式规则。最新的基于强化学习(RL)的方法具有从反馈中捕获这些模式的潜力,但由于调度空间大、采样成本高和样本利用率差,直接应用它们并非易事。受这些挑战的启发,我们提出了BQSched,一种基于强化学习的批量并发查询非侵入式调度器。具体而言,BQSched设计了基于注意力的状态表示来捕获复杂的查询模式,并提出了IQ-PPO,一种辅助任务增强的近端策略优化(PPO)算法,以充分利用日志中单个查询完成的丰富信号。基于上述RL框架,BQSched进一步引入了三种优化策略,包括自适应掩码以修剪动作空间、基于调度增益的查询聚类以处理大型查询集,以及增量模拟器以降低采样成本。据我们所知,BQSched是第一个基于RL的非侵入式批量查询调度器。大量实验表明,BQSched能显著提高批量查询调度的效率和稳定性,同时在数据和查询方面实现卓越的可扩展性和适应性。例如,在所有测试的DBMS和规模中,与常用的启发式策略和适配的基于RL的调度器相比,BQSched将TPC-DS基准上的批量查询整体完成时间分别平均减少了34%和13%。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑