Lune

VLDB2026Top-tier venue

Towards Efficient Random-Order Enumeration for Join Queries

Pengyu Chen, Zizheng Guo, Jianwei Yang, Dongjing Miao

Abstract

In many data analysis pipelines, a basic and time-consuming process is to produce join results and feed them into downstream tasks. Numerous enumeration algorithms have been developed for this purpose. To be a statistically meaningful representation of the whole join result, the result tuples are required to be enumerated in uniformly random order. However, existing studies lack an efficient random-order enumeration algorithm with a worst-case runtime guarantee for (cyclic) join queries. In this paper, we study the problem of enumerating the results of a join query in random order. We develop an efficient random-order enumeration algorithm for join queries with no large hidden constants in its complexity, achieving expected O(AGM(Q)∣Res(Q)∣log⁡2∣Q∣)O(\frac{\mathrm{AGM}(Q)}{|Res(Q)|}\log^2|Q|) delay, O(AGM(Q)log⁡∣Q∣)O(\mathrm{AGM}(Q)\log|Q|) total running time after O(∣Q∣log⁡∣Q∣)O(|Q|\log|Q|)-time index construction, where ∣Q∣|Q| is the size of input, AGM(Q)\mathrm{AGM}(Q) is the AGM bound, and ∣Res(Q)∣|Res(Q)| is the size of the join result. We prove that our algorithm is near-optimal in the worst case, under the combinatorial kk-clique hypothesis. Our algorithm requires no query-specific preprocessing and can be flexibly adapted to many common database indexes with only minor modifications. We also devise two non-trivial techniques to speed up the enumeration, and provide an experimental study on our enumeration algorithm along with the speed-up techniques. The experimental results show that our algorithm, enhanced with the proposed techniques, significantly outperforms existing state-of-the-art methods.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

Builds onCited byLeft to right by year; the more cited, the higher.

Builds on1

  1. PGMJoins: Random Join Sampling with Graphical ModelsAli Mohammadi Shanghooshabad, Meghdad Kurmanji, Qingzhi Ma, Michael Shekelyan et al.SIGMOD 2021 · 13 citations

Related papers

  1. Ranked Enumeration of Join Queries with ProjectionsShaleen Deep, Xiao Hu, Paraschos KoutrisVLDB 2022 · 14 citations
  2. Optimal Algorithms for Ranked Enumeration of Answers to Full Conjunctive QueriesNikolaos Tziavelis, Deepak Ajwani, Wolfgang Gatterbauer, Mirek Riedewald et al.VLDB 2020 · 45 citations
  3. Beyond Equi-joins: Ranking, Enumeration and FactorizationNikolaos Tziavelis, Wolfgang Gatterbauer, Mirek RiedewaldVLDB 2021 · 24 citations
  4. Efficiently Computing Join Orders with Heuristic SearchImmanuel Haffner, Jens DittrichSIGMOD 2023 · 8 citations
  5. Reservoir Sampling over JoinsBinyang Dai, Xiao Hu, Ke YiSIGMOD 2024 · 6 citations
Dusk over the sea between two cliffs drawn in fine vertical lines