Worstcase Optimal Join Algorithms Techniques Results and Open






![• Geometry • [Loomis-Whitney 1949, isoperimetric inequalities] • [Bollobas-Thomason 1995] the Holder argument! • Geometry • [Loomis-Whitney 1949, isoperimetric inequalities] • [Bollobas-Thomason 1995] the Holder argument!](https://slidetodoc.com/presentation_image_h/1750c492abb123bd2501c2b952776dc9/image-7.jpg)



















![The Entropy Argument [ANS’ 16] • • Is a cone Not topologically closed Not The Entropy Argument [ANS’ 16] • • Is a cone Not topologically closed Not](https://slidetodoc.com/presentation_image_h/1750c492abb123bd2501c2b952776dc9/image-27.jpg)























- Slides: 50
Worst-case Optimal Join Algorithms Techniques, Results, and Open Problems Hung Q. Ngo Relational. AI Inc. Based on Joint Works with Mahmoud Abo Khamis, Ely Porat, Chris Re , Atri Rudra, Dan Suciu PODS 2018 1
Formulation sketch Paper with the same title on Ar. Xi. V contains much more details and references PODS 2018 2
Three Fundamental Problems in RDBMS 1. Query plans • Based on variable elimination and (equivalently) tree decompositions • Very general query types (Boolean, aggregations, max, min, CSP, PGM, etc. ) • Refs: • [FDB: Olteanu, Závodný TODS’ 13] • [FAQ: Abo Khamis, Ngo, Rudra PODS’ 16 / SIGMOD Records 16] • [TD: Gottlob, Greco, Leone, Scarcello PODS’ 16] 2. Output size bound 3. Worst-case optimal join algorithms • To evaluate intermediate queries 3
Notations • A R B T S C 4
Degree Constraints A B C 1 1 1 2 3 2 1 4 2 1 5 2 1 6 3 1 7 3 2 8 • 5
Twin Problems • 6
• Geometry • [Loomis-Whitney 1949, isoperimetric inequalities] • [Bollobas-Thomason 1995] the Holder argument! • Extremal combinatorics, graph theory • [Alon 81] • [Chung, Graham, Frankl, Shearer, 86] the entropy argument! • [Friedgut-Kahn 98] • Constraint satisfaction • [Grohe & Marx SODA’ 06] • Databases • • [Atserias, Grohe, Marx FOCS’ 08] [Gottlob, Lee, Valiant JACM’ 2012] [Ngo, Porat, Re, Rudra PODS’ 12] [Abo Khamis, Ngo, Suciu PODS’ 16, PODS’ 17] 7
Geometric Connection A R(A, B) T(A, C) B S(B, C) C PODS 2018 8
Takeaways • 10
Triangle Query Dissected PODS 2018 11
Any Pairwise Join Plan is Sub-Optimal T R S Ω(N 2) R T � S � � � Ω(N 2) T R � S Ω(N 2) R S � T 13
The Holder Argument Cauchy-Schwarz 14
Algorithm from Holder argument Total runtime: 15
The Entropy View (Shearer) 5 A B 1 1 1 A C 1/6 1 1 2 1/6 1 2 1 1/3 2 2 1/3 3 1 0 3 3 0 B C 1/3 1 1 2 1/3 1 2 2 1/3 2 5 ¼ 2 6 0 6 4 A B C 1/3 1 1/6 2 1/3 1 1 2 1/6 2 1 1/6 1 2 1 1/6 2 2 1/6 1 2 2 1/6 2 2 1 1/6 2 2 2 1/6 16
Information Theory Detour • Shannon-type inequalities 17
The Entropy Argument There is a joint distribution on (A, B, C) for which h is the entropy function of Defn. of conditional entropy Submodularity, twice 18
Algorithm from Entropy Argument 19
Holder-based Bound Holder wasn’t the first to prove the inequality 20
Fractional Edge Cover • A R C R T S B A T S B C 21
Friedgut Inequality (2004) • A R B T S C 22
23
Entropy-based Bound Lots of open problems PODS 2018 25
Information Theory Reminder • Shannon-type inequalities 26
The Entropy Argument [ANS’ 16] • • Is a cone Not topologically closed Not polyhedral Membership not known to be decidable 27
28
• • Modular bound Efficiently computable • • Entropic bound Not known to be computable • • • Polymatroid bound Computable Not (known to be) efficiently computable Not tight Becomes fractional edge cover # under cardinality constraints • • • Becomes integral edge cover # under cardinality constraints 29
Natural Follow-Up Questions • • Entropic bound Not known to be computable Polymatroid bound Computable, not tight When do these two bounds collide? When they do, is there a matching algorithm? 30
Degree-Constraint Dependency Graph • A B C 31
Acyclic Degree Constraints & Properties • 32
• • Fractional vertex packing Fractional edge covering 33
Natural Follow-Up Questions • • Entropic bound Not known to be computable Polymatroid bound Computable, not tight When do these two bounds collide? Acyclic DC is sufficient When they do, is there a matching algorithm? Yes, a Holder-based algorithm 34
But what if DC is not acyclic? • 35
Holder-based Algorithm Backtracking search, along the line of LFTJ & Generic Join 36
Backtracking Search for Acylic DC BTS • 37
The Sub-Problems • A B C a 1 1 a 1 2 a 2 3 a’ 1 1 a’ 1 2 a’ 1 3 a’’ 1 1 a’’ 2 2 38
Analysis Induction hypothesis Friedgut inequality 39
Entropy-based Algorithm Where Shannon-type inequalities are interpreted as relational operators 40
So we have to settle for less • • Entropic bound Not known to be computable Polymatroid bound Computable, not tight • 41
Example • Constraint Guard AMW 2018 42
Corresponding Shannon-flow inequality • 43
Proof sequence 44
PANDA Proof step Operation Action Partition NOOP Join 45
Open Problems Some are much harder than others 46
1. Is the entropic bound computable? 2. What is the computational (query) complexity of computing the polymatroid bound? 47
5. Improve the (humongous) hidden factors in PANDA 6. Theory and algorithm for average case output size bound 7. Theory and practical algorithms for instance-optimal query evaluation 8. Theory and practical algorithms for optimizers of multi-way join operators 48
Spectrum of Problems and Solutions Simple Complex Constraints Cardinality only Output size bound Tight & poly-time computable in query complexity Tight & not (known to be) computable Not tight & computable (but not known to be in P) Argument Holder argument Entropy argument Best known algorithms NPRR, LFTJ, Generic Join PANDA Simple Complicated Worst-case optimal Not worst-case optimal Requires intermediates Based on Holder-style proof Based on Shannon-type inequality style proof Practical (Logic. Blox, Relational. AI, etc. ) … See writeup 49
Thank you! PODS 2018 50


















































