ALECE: An Attention-based Learned Cardinality Estimator for SPJ Queries on Dynamic Workloads

Pengfei Li, Wenqing Wei, Rong Zhu*, Bolin Ding*, Jingren Zhou*, Hua Lu*

*Corresponding author

Publikation: Bidrag til tidsskriftKonferenceartikelForskningpeer review

Abstract

For efficient query processing, DBMS query optimizers have for decades relied on delicate cardinality estimation methods. In this work, we propose an Attention-based LEarned Cardinality Estimator (ALECE for short) for SPJ queries. The core idea is to discover the implicit relationships between queries and underlying dynamic data using attention mechanisms in ALECE's two modules that are built on top of carefully designed featurizations for data and queries. In particular, from all attributes in the database, the data-encoder module obtains organic and learnable aggregations which implicitly represent correlations among the attributes, whereas the query-analyzer module builds a bridge between the query featurizations and the data aggregations to predict the query's cardinality. We experimentally evaluate ALECE on multiple dynamic workloads. The results show that ALECE enables PostgreSQL's optimizer to achieve nearly optimal performance, clearly outperforming its built-in cardinality estimator and other alternatives.

OriginalsprogEngelsk
TidsskriftProceedings of the VLDB Endowment
Vol/bind17
Udgave nummer2
Sider (fra-til)197-210
Antal sider14
ISSN2150-8097
DOI
StatusUdgivet - 2023
Begivenhed50th International Conference on Very Large Data Bases - Guangzhou, Kina
Varighed: 24 aug. 202429 aug. 2024
Konferencens nummer: 50

Konference

Konference50th International Conference on Very Large Data Bases
Nummer50
Land/OmrådeKina
ByGuangzhou
Periode24/08/202429/08/2024

Bibliografisk note

Publisher Copyright:
© 2023, VLDB Endowment. All rights reserved.

Citer dette