PGMJoins: Random Join Sampling with Graphical Models
Ali Mohammadi Shanghooshabad, Meghdad Kurmanji, Qingzhi Ma, Michael Shekelyan, Mehrdad Almasi, Peter Triantafillou
Abstract
Modern databases face formidable challenges when called to join (several) massive tables. Joins (especially when entailing many-to-many joins) are very time- and resource-consuming, join results can be too big to keep in memory, and performing analytics/learning tasks over them costs dearly in terms of time, resources, and money (in the cloud). Moreover, although random sampling is a promising idea to mitigate the above problems, the current state of the art leaves lots of room for improvements. With this paper we contribute a principled solution, coined PGMJoins. PGMJoins adapts Probabilistic Graphical Models to deriving provably random samples of the join result for (n-way) key joins, many-to-many joins, and cyclic and acyclic joins. PGMJoins contributes optimizations both for deriving the structure of the graph and for PGM inference. It also contributes a novel Sum-Product Message Passing Algorithm (SP-MPA) to make a uniform sample of the joint distribution (join result) efficiently and a novel way to deal with cyclic joins. Despite the use of PGMs, the learned joint distribution is not approximated, and the uniform samples are drawn from the true distribution. Our experimentation using queries and datasets from TPC-H, JOB, TPC-DS, and Twitter shows PGMJoins to outperform the state of the art (by 2X-28X).
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get 24c08938-317a-4ea2-98b0-e79d9cdd1eb4Cited by top-tier papers7
- Learned Cardinality Estimation: An In-depth StudyKyoungmin Kim, Jisung Jung, In Seo, Wook-Shin Han et al.SIGMOD 2022 · 51 citations
- JoinBoost: Grow Trees Over Normalized Data Using Only SQLZezhou Huang, Rathijit Sen, Jiaxiang Liu, Eugene WuVLDB 2023 · 23 citations
- Detect, Distill and Update: Learned DB Systems Facing Out of Distribution DataMeghdad Kurmanji, Peter TriantafillouSIGMOD 2023 · 19 citations
- Machine Unlearning in Learned Databases: An Experimental AnalysisMeghdad Kurmanji, Eleni Triantafillou, Peter TriantafillouSIGMOD 2024 · 12 citations
- Random Sampling Over Spatial Range JoinsDaichi AmagataICDE 2025 · 3 citations
Related papers
- Towards Efficient Random-Order Enumeration for Join QueriesPengyu Chen, Zizheng Guo, Jianwei Yang, Dongjing MiaoVLDB 2026
- GenJoin: Conditional Generative Plan-to-Plan Query Optimizer that Learns from Subplan HintsPavel Sulimov, Claude Lehmann, Kurt StockingerSIGMOD 2026 · 3 citations
- Learning General Latent-Variable Graphical Models with Predictive Belief PropagationBorui Wang, Geoffrey J. GordonAAAI 2020 · 1 citation
- FactorJoin: A New Cardinality Estimation Framework for Join QueriesZiniu Wu, Parimarjan Negi, Mohammad Alizadeh, Tim Kraska et al.SIGMOD 2023 · 54 citations
- Poisson Sampling over Acyclic JoinsLiese Bekkers, Frank Neven, Lorrens Pantelis, Stijn VansummerenSIGMOD 2026 · 1 citation
