CARPO: Leveraging Listwise Learning-to-Rank for Context-Aware Query Plan Optimization

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zhou, Wenrui, Liu, Qiyu, Peng, Jingshu, Zhang, Aoqian, Chen, Lei
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908604074819584
author Zhou, Wenrui
Liu, Qiyu
Peng, Jingshu
Zhang, Aoqian
Chen, Lei
author_facet Zhou, Wenrui
Liu, Qiyu
Peng, Jingshu
Zhang, Aoqian
Chen, Lei
contents Efficient data processing is increasingly vital, with query optimizers playing a fundamental role in translating SQL queries into optimal execution plans. Traditional cost-based optimizers, however, often generate suboptimal plans due to flawed heuristics and inaccurate cost models, leading to the emergence of Learned Query Optimizers (LQOs). To address challenges in existing LQOs, such as the inconsistency and suboptimality inherent in pairwise ranking methods, we introduce CARPO, a generic framework leveraging listwise learning-to-rank for context-aware query plan optimization. CARPO distinctively employs a Transformer-based model for holistic evaluation of candidate plan sets and integrates a robust hybrid decision mechanism, featuring Out-Of-Distribution (OOD) detection with a top-k fallback strategy to ensure reliability. Furthermore, CARPO can be seamlessly integrated with existing plan embedding techniques, demonstrating strong adaptability. Comprehensive experiments on TPC-H and STATS benchmarks demonstrate that CARPO significantly outperforms both native PostgreSQL and Lero, achieving a Top-1 Rate of 74.54% on the TPC-H benchmark compared to Lero's 3.63%, and reducing the total execution time to 3719.16 ms compared to PostgreSQL's 22577.87 ms.
format Preprint
id arxiv_https___arxiv_org_abs_2509_03102
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle CARPO: Leveraging Listwise Learning-to-Rank for Context-Aware Query Plan Optimization
Zhou, Wenrui
Liu, Qiyu
Peng, Jingshu
Zhang, Aoqian
Chen, Lei
Databases
Efficient data processing is increasingly vital, with query optimizers playing a fundamental role in translating SQL queries into optimal execution plans. Traditional cost-based optimizers, however, often generate suboptimal plans due to flawed heuristics and inaccurate cost models, leading to the emergence of Learned Query Optimizers (LQOs). To address challenges in existing LQOs, such as the inconsistency and suboptimality inherent in pairwise ranking methods, we introduce CARPO, a generic framework leveraging listwise learning-to-rank for context-aware query plan optimization. CARPO distinctively employs a Transformer-based model for holistic evaluation of candidate plan sets and integrates a robust hybrid decision mechanism, featuring Out-Of-Distribution (OOD) detection with a top-k fallback strategy to ensure reliability. Furthermore, CARPO can be seamlessly integrated with existing plan embedding techniques, demonstrating strong adaptability. Comprehensive experiments on TPC-H and STATS benchmarks demonstrate that CARPO significantly outperforms both native PostgreSQL and Lero, achieving a Top-1 Rate of 74.54% on the TPC-H benchmark compared to Lero's 3.63%, and reducing the total execution time to 3719.16 ms compared to PostgreSQL's 22577.87 ms.
title CARPO: Leveraging Listwise Learning-to-Rank for Context-Aware Query Plan Optimization
topic Databases
url https://arxiv.org/abs/2509.03102