PRICE
Pretrained self-attention model that estimates query cardinality on databases it has not seen.
Tabular and recommender · 1,439 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 10.7M
- Operations
- 1,439
- Framework
- PyTorch
- Recurrent
- No
- Published
- PVLDB 18(3) (arXiv 2024)
- Cited by
- 13 (as of 27 October 2026)
- Authors
- Tianjing Zeng, Junwei Lan, Jiahong Ma and others
- Source
- GitHub: StCarmen/PRICE
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m19182
- Graph hash
- 6e23ec4756a20a475e770544fc3971857d3ba24dcfa910e3d5194e5d8319de71
- Skeleton hash
- 5d347b7a4339e905cf91195457909de42f05932821b226f72bf88415a55da907
- Architecture hash
- 9084c4c38f4d6497f694d1c1613365d2931c17f47899488d14ade4f511584391
- Diagram SHA-256
- dd5b54b42339d92fb7264cea8b340ce3eb10581a7056cf70e26cfd2abe6c059c
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
PRICE is a pretrained model for cardinality estimation (CardEst), a step that is essential for optimizing query execution plans in a database. According to the paper, recent ML-based CardEst methods reach high accuracy but are hard to deploy because of high preparation costs and a lack of transferability across databases. PRICE is designed to be applied to an unseen new database, and it can also be finetuned on a specific one.
The transfer rests on the inputs, whose feature representations keep the same semantics across different databases. They are the value distribution of each attribute as a 1-D histogram, the distribution of scaling factors of each join condition, also as a histogram, and some characteristics of each filtering predicate. The model also takes the cardinality estimated by traditional methods, such as the histogram-based methods in PostgreSQL. PRICE works in three main stages: an embedding stage, a joining stage and a filtering stage. In the joining stage a self-attention module integrates the information about the attributes in the join conditions, and in the filtering stage another self-attention module fuses that with all filtering predicates.
The paper pretrains PRICE on 30 diverse datasets and reports that this takes about 5 hours and gives a model size of about 40MB. The pretraining command in the repository sets an embedding size of 256 with 6 layers and 8 heads.
Key idea. PRICE shows that a self-attention model pretrained on histogram and query features that are transferable across databases can estimate cardinality on unseen databases.
- price
- pretrained multi-table cardest model
- cardinality estimation
- cardest
- cross-database cardinality estimation
- query optimization
- learned cardinality estimator
- database
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{zeng2024pricepretrainedmodelcrossdatabase,
title={PRICE: A Pretrained Model for Cross-Database Cardinality Estimation},
author={Tianjing Zeng and Junwei Lan and Jiahong Ma and Wenqing Wei and Rong Zhu and Pengfei Li and Bolin Ding and Defu Lian and Zhewei Wei and Jingren Zhou},
year={2024},
eprint={2406.01027},
archivePrefix={arXiv},
primaryClass={cs.DB},
doi={https://doi.org/10.14778/3712221.3712231},
url={https://arxiv.org/abs/2406.01027},
}