NeuroCard
A masked autoregressive network that estimates join cardinalities from one model trained on a full outer join sample.
Tabular and recommender · 198 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
- 1M
- Operations
- 198
- Framework
- PyTorch
- Recurrent
- No
- Published
- VLDB 2021
- Cited by
- 26 (as of 29 October 2026)
- Authors
- Zongheng Yang, Amog Kamsetty, Frank Sifei Luan and others
- Source
- GitHub: neurocard/neurocard
- License
- Apache-2.0
- 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
- m18874
- Graph hash
- cc1cdb7a7434711bddc6afce61a923c089f6425354523a67b66c976b74088df2
- Skeleton hash
- 990e99b428ac5de80905e40d220105697a866f8ea0efac35caace8dfb7023cd8
- Architecture hash
- 67d9646954291c1b67c5e13b747cf8348838753ac0d5eac774638494faa5cbb4
- Diagram SHA-256
- 47c2061904fdbe9523a74358c10b27a90ed9def7dcbcf436bc7abf6903f4f42a
- 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
NeuroCard is a learned estimator of join cardinalities, the row-count estimates a database query optimizer relies on when choosing an execution plan. What sets it apart in the paper is that one deep autoregressive (AR) model captures the correlations across all the joins of a schema, with no independence assumptions.
The model is trained on samples from the full outer join of all tables, so it can answer a query touching any subset of them. The network is ResMADE, the same architecture used by Naru, the single-table estimator that NeuroCard builds on. Each column value is embedded, and the concatenated embeddings pass through residual blocks of two masked linear layers, where the masks enforce the autoregressive ordering. The output logits are computed by dotting the last layer's output with the embedding matrices.
Because an AR model stores an embedding per distinct value, a column with many distinct values is split into subcolumns, each holding a chunk of bits of the original value, which the paper calls lossless column factorization. On the JOB-light benchmark, the 6-table schema this model is configured for, the paper reports a maximum Q-error of 8.5× using 4 MB.
Key idea. NeuroCard builds a single autoregressive density estimator over the full outer join of all tables in a database, estimating join cardinalities without independence assumptions.
- NeuroCard
- cardinality estimation
- join cardinality estimator
- learned cardinality estimator
- query optimization
- autoregressive density model
- full outer join
- JOB-light
- database
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{yang2020neurocardcardinalityestimatortables,
title={NeuroCard: One Cardinality Estimator for All Tables},
author={Zongheng Yang and Amog Kamsetty and Sifei Luan and Eric Liang and Yan Duan and Xi Chen and Ion Stoica},
year={2020},
eprint={2006.08109},
archivePrefix={arXiv},
primaryClass={cs.DB},
url={https://arxiv.org/abs/2006.08109},
}