Data-Agnostic Cardinality Learning from Imperfect Workloads

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Wu, Peizhi, Kang, Rong, Zhang, Tieying, Chen, Jianjun, Marcus, Ryan, Ives, Zachary G.
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911013553569792
author Wu, Peizhi
Kang, Rong
Zhang, Tieying
Chen, Jianjun
Marcus, Ryan
Ives, Zachary G.
author_facet Wu, Peizhi
Kang, Rong
Zhang, Tieying
Chen, Jianjun
Marcus, Ryan
Ives, Zachary G.
contents Cardinality estimation (CardEst) is a critical aspect of query optimization. Traditionally, it leverages statistics built directly over the data. However, organizational policies (e.g., regulatory compliance) may restrict global data access. Fortunately, query-driven cardinality estimation can learn CardEst models using query workloads. However, existing query-driven models often require access to data or summaries for best performance, and they assume perfect training workloads with complete and balanced join templates (or join graphs). Such assumptions rarely hold in real-world scenarios, in which join templates are incomplete and imbalanced. We present GRASP, a data-agnostic cardinality learning system designed to work under these real-world constraints. GRASP's compositional design generalizes to unseen join templates and is robust to join template imbalance. It also introduces a new per-table CardEst model that handles value distribution shifts for range predicates, and a novel learned count sketch model that captures join correlations across base relations. Across three database instances, we demonstrate that GRASP consistently outperforms existing query-driven models on imperfect workloads, both in terms of estimation accuracy and query latency. Remarkably, GRASP achieves performance comparable to, or even surpassing, traditional approaches built over the underlying data on the complex CEB-IMDb-full benchmark -- despite operating without any data access and using only 10% of all possible join templates.
format Preprint
id arxiv_https___arxiv_org_abs_2506_16007
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Data-Agnostic Cardinality Learning from Imperfect Workloads
Wu, Peizhi
Kang, Rong
Zhang, Tieying
Chen, Jianjun
Marcus, Ryan
Ives, Zachary G.
Databases
Machine Learning
Cardinality estimation (CardEst) is a critical aspect of query optimization. Traditionally, it leverages statistics built directly over the data. However, organizational policies (e.g., regulatory compliance) may restrict global data access. Fortunately, query-driven cardinality estimation can learn CardEst models using query workloads. However, existing query-driven models often require access to data or summaries for best performance, and they assume perfect training workloads with complete and balanced join templates (or join graphs). Such assumptions rarely hold in real-world scenarios, in which join templates are incomplete and imbalanced. We present GRASP, a data-agnostic cardinality learning system designed to work under these real-world constraints. GRASP's compositional design generalizes to unseen join templates and is robust to join template imbalance. It also introduces a new per-table CardEst model that handles value distribution shifts for range predicates, and a novel learned count sketch model that captures join correlations across base relations. Across three database instances, we demonstrate that GRASP consistently outperforms existing query-driven models on imperfect workloads, both in terms of estimation accuracy and query latency. Remarkably, GRASP achieves performance comparable to, or even surpassing, traditional approaches built over the underlying data on the complex CEB-IMDb-full benchmark -- despite operating without any data access and using only 10% of all possible join templates.
title Data-Agnostic Cardinality Learning from Imperfect Workloads
topic Databases
Machine Learning
url https://arxiv.org/abs/2506.16007