It’s All a Matter of Degree

We optimize multiway equijoins on relational tables using degree information. We give a new bound that uses degree information to more tightly bound the maximum output size of a query. On real data, our bound on the number of triangles in a social network can be up to 95 times tighter than existing worst case bounds. We show that using only a constant amount of degree information, we are able to obtain join algorithms with a running time that has a smaller exponent than existing algorithms–for any database instance. We also show that this degree information can be obtained in nearly linear time, which yields asymptotically faster algorithms in the serial setting and lower communication cost algorithms in the MapReduce setting. In the serial setting, the data complexity of join processing can be expressed as a function O(INx + OUT) in terms of input size IN and output size OUT in which x depends on the query. An upper bound for x is given by the fractional hypertreewidth. We are interested in situations in which we can get algorithms for which x is strictly smaller than the fractional hypertreewidth. We say that a join can be processed in subquadratic time if x < 2. Building on the AYZ algorithm for processing cycle joins in quadratic time, for a restricted class of joins which we call 1-series-parallel graphs, we obtain a complete decision procedure for identifying subquadratic solvability (subject to the 3-SUM problem requiring quadratic time). Our 3-SUM based quadratic lower bound is tight, making it the only known tight bound for joins that does not require any assumption about the matrix multiplication exponent ω. We also give a MapReduce algorithm that meets our improved communication bound and handles essentially optimal parallelism.

[1]  Mihalis Yannakakis,et al.  Algorithms for Acyclic Database Schemes , 1981, VLDB.

[2]  Christopher Ré,et al.  GYM: A Multiround Join Algorithm In MapReduce , 2014, ArXiv.

[3]  Nikolai K. Vereshchagin,et al.  Partitioning multi-dimensional sets in a small number of "uniform" parts , 2005, Eur. J. Comb..

[4]  Christopher Ré,et al.  It's All a Matter of Degree: Using Degree Information to Optimize Multiway Joins , 2016, ICDT.

[5]  Jeffrey D. Ullman,et al.  Optimizing Multiway Joins in a Map-Reduce Environment , 2011, IEEE Transactions on Knowledge and Data Engineering.

[6]  Jeffrey D. Ullman,et al.  Upper and Lower Bounds on the Cost of a Map-Reduce Computation , 2012, Proc. VLDB Endow..

[7]  Todd L. Veldhuizen,et al.  Leapfrog Triejoin: a worst-case optimal join algorithm , 2012, ArXiv.

[8]  Anand Rajaraman,et al.  Conjunctive query containment revisited , 1997, Theor. Comput. Sci..

[9]  Dániel Marx,et al.  Tractable Hypergraph Properties for Constraint Satisfaction and Conjunctive Queries , 2009, JACM.

[10]  Erik D. Demaine,et al.  Subquadratic Algorithms for 3SUM , 2005, Algorithmica.

[11]  Jonathan L. Gross,et al.  Handbook of graph theory , 2007, Discrete mathematics and its applications.

[12]  Dániel Marx,et al.  Size Bounds and Query Plans for Relational Joins , 2008, 2008 49th Annual IEEE Symposium on Foundations of Computer Science.

[13]  Dan Suciu,et al.  Skew in parallel query processing , 2014, PODS.

[14]  Uri Zwick,et al.  Listing Triangles , 2014, ICALP.

[15]  Jure Leskovec,et al.  {SNAP Datasets}: {Stanford} Large Network Dataset Collection , 2014 .

[16]  Noga Alon,et al.  Finding and Counting Given Length Cycles (Extended Abstract) , 1994, ESA.

[17]  Jonathan L. Gross,et al.  Handbook of Graph Theory, Second Edition , 2013 .

[18]  Dan Suciu,et al.  Parallel evaluation of conjunctive queries , 2011, PODS.

[19]  Georg Gottlob,et al.  Hypertree Decompositions: Structure, Algorithms, and Applications , 2005, WG.

[20]  Atri Rudra,et al.  Skew strikes back: new developments in the theory of join algorithms , 2013, SGMD.