Reproduce “Zero-Shot Cost Models for Out-of-the-box Learned Cost Prediction” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Benjamin Hilprecht, Carsten Binnig

Researchers from TU Darmstadt introduce zero-shot cost models that accurately predict query runtimes on new, unseen databases without requiring any prior training queries on those specific databases. This approach leverages pre-trained graph neural networks and transferable query representations, achieving performance comparable to workload-driven models while drastically reducing training overhead and demonstrating robustness to database updates.

Key insights

  • Separating the database-agnostic cost model from database-dependent data characteristics via explicit inputs is crucial for achieving generalization across diverse databases.
  • A graph-based query plan representation combined with transferable features, rather than database-specific encodings, allows the model to learn general costing principles applicable to new environments.
  • Zero-shot models can be further enhanced through few-shot learning, where a small number of queries from a new workload can quickly fine-tune the pre-trained model for even higher accuracy.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.