SPQO: Learning to Safely Reuse Cached Plans for Dynamic Workloads

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Learning-based Parametric Query Optimization (PQO) methods excel in static workloads with precise cached plan selection but struggle with dynamic workloads. When facing a parametric query outside query parameter distribution in its training workload, suboptimal plan could be selected and this plan would be unsafely reused. The root cause of this limitation is the plan selection model cannot adapt to distribution drifts in query parameters. In order to extend learning-based Parametric Query Optimization for safely reusing cached plans in dynamic workloads, we introduce a novel approach to predict and avoid reusing a suboptimal plan, referred to as SPQO. As each cached plan has specific reuse decision boundary, each cached plan is assigned to an independent binary classifier. In the offline phase, we employ an under-sampling algorithm integrated with Tomek Links technique to effectively train these classifiers under class imbalance setting. During the online phase, we implement hybrid adjustment strategies based on incremental learning, continuously training these classifiers with each prediction and query feedback. Our experiments show SPQO can reduce the 95th percentile relative query latency by 10× in static and 103× in dynamic workloads, and achieve better cache hit rates on various workloads.

Original languageEnglish
Title of host publicationDatabase Systems for Advanced Applications - 29th International Conference, DASFAA 2024, Proceedings
EditorsMakoto Onizuka, Jae-Gil Lee, Yongxin Tong, Chuan Xiao, Yoshiharu Ishikawa, Kejing Lu, Sihem Amer-Yahia, H.V. Jagadish
PublisherSpringer Science and Business Media Deutschland GmbH
Pages315-330
Number of pages16
ISBN (Print)9789819755516
DOIs
StatePublished - 2024
Event29th International Conference on Database Systems for Advanced Applications, DASFAA 2024 - Gifu, Japan
Duration: 2 Jul 20245 Jul 2024

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume14850 LNCS
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Conference

Conference29th International Conference on Database Systems for Advanced Applications, DASFAA 2024
Country/TerritoryJapan
CityGifu
Period2/07/245/07/24

Keywords

  • Machine learning
  • Parametric query optimization
  • Query optimization
  • Query plan cache

Fingerprint

Dive into the research topics of 'SPQO: Learning to Safely Reuse Cached Plans for Dynamic Workloads'. Together they form a unique fingerprint.

Cite this