Lune

VLDB2026Top-tier venue

BaCon: Efficient Batch Processing of Counting Queries

Yuxi Liu, Xiao Hu, Pankaj K. Agarwal, Jun Yang

2026Year

Abstract

Counting queries are ubiquitous in database systems, particularly for driving internal system optimization. Learned models for cardinality estimation rely heavily on large-scale training data, yet generating such data by executing massive batches of counting queries is expensive. We propose BaCon, an efficient algorithm for batch evaluation of counting queries on top of a database system, without modifying its internals. BaCon integrates the idea of factorized databases with a workload-aware domain quantization strategy, allowing it to evaluate batches of counting queries using compact data structures rather than materializing massive join results. Ba-Con's design is compatible with most database management system, and we have implemented it as a client-side application on Post-greSQL with a lightweight C-language UDF (user-defined function). This implementation delivers speedups between 2× and 178× over baselines and good performance across various workloads, making training and maintenance of learned cardinality estimation models significantly more practical.

Ask about this paper

Your agent reads all of it.

Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

lune papers fulltext 5290f974-cfc0-444a-97c6-ea7493daa2c9

Builds on22

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines