<p>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 varying 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, poor sample utilization, and limited generalization ability. Motivated by these challenges, we propose BQSched<InlineEquation ID="IEq4"> <EquationSource Format="TEX">\(^{+}\)</EquationSource> <EquationSource Format="MATHML"><math> <mmultiscripts> <mrow /> <mrow /> <mo>+</mo> </mmultiscripts> </math></EquationSource> </InlineEquation>, a generalizable RL-based Scheduler for varying Batch concurrent Queries. Specifically, we design a grouped attention-based state representation that captures the complex query patterns efficiently by incorporating the interaction patterns of different query groups and supports varying batch queries. We also propose IQ-PPO-m, an auxiliary task-enhanced proximal policy optimization (PPO) algorithm with multi-task balancing, to fully exploit the rich signals of Individual Query completion in logs and enable the learned policy to adapt to varying query sets. Based on the RL framework above, we further introduce 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. Extensive experiments show that BQSched<InlineEquation ID="IEq5"> <EquationSource Format="TEX">\(^{+}\)</EquationSource> <EquationSource Format="MATHML"><math> <mmultiscripts> <mrow /> <mrow /> <mo>+</mo> </mmultiscripts> </math></EquationSource> </InlineEquation> can significantly improve the efficiency and stability of batch query scheduling, while also achieving remarkable scalability and generalizability in both data and queries. For example, across all DBMSs and scales tested, BQSched<InlineEquation ID="IEq6"> <EquationSource Format="TEX">\(^{+}\)</EquationSource> <EquationSource Format="MATHML"><math> <mmultiscripts> <mrow /> <mrow /> <mo>+</mo> </mmultiscripts> </math></EquationSource> </InlineEquation> 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. The source code of BQSched<InlineEquation ID="IEq7"> <EquationSource Format="TEX">\(^{+}\)</EquationSource> <EquationSource Format="MATHML"><math> <mmultiscripts> <mrow /> <mrow /> <mo>+</mo> </mmultiscripts> </math></EquationSource> </InlineEquation> is available at <a href="https://github.com/chxu2000/BQSched">https://github.com/chxu2000/BQSched</a>.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

BQSched\(^{+}\): A generalizable RL-based scheduler for varying batch concurrent queries

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

摘要

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 varying 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, poor sample utilization, and limited generalization ability. Motivated by these challenges, we propose BQSched \(^{+}\) + , a generalizable RL-based Scheduler for varying Batch concurrent Queries. Specifically, we design a grouped attention-based state representation that captures the complex query patterns efficiently by incorporating the interaction patterns of different query groups and supports varying batch queries. We also propose IQ-PPO-m, an auxiliary task-enhanced proximal policy optimization (PPO) algorithm with multi-task balancing, to fully exploit the rich signals of Individual Query completion in logs and enable the learned policy to adapt to varying query sets. Based on the RL framework above, we further introduce 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. Extensive experiments show that BQSched \(^{+}\) + can significantly improve the efficiency and stability of batch query scheduling, while also achieving remarkable scalability and generalizability 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. The source code of BQSched \(^{+}\) + is available at https://github.com/chxu2000/BQSched.