Abstract 1 Introduction 2 Related Work 3 Preliminaries 4 Enumerating Join Trees 5 The Canonical Join Tree of a Berge-Acyclic Query 6 Converting a Binary Join Plan to a Join Tree 7 Conclusion and Future Work References

Algorithms for Optimizing Acyclic Queries

Zheng Luo ORCID University of California, Los Angeles, CA, USA Wim Van den Broeck ORCID University of Bergen, Norway Guy Van den Broeck ORCID University of California, Los Angeles, CA, USA Yisu Remy Wang ORCID University of California, Los Angeles, CA, USA
Abstract

Most research on query optimization has centered on binary join algorithms like hash join and sort-merge join. However, recent years have seen growing interest in theoretically optimal algorithms, notably Yannakakis’ algorithm. These algorithms rely on join trees, which differ from the operator trees for binary joins and require new optimization techniques. We propose three approaches to constructing join trees for acyclic queries. First, we give an algorithm to enumerate all join trees of an α-acyclic query by edits in linear time with amortized constant delay, which forms the basis of a cost-based optimizer for acyclic joins. Second, we show the Maximum Cardinality Search algorithm by Tarjan and Yannakakis constructs the unique shallowest join tree for any Berge-acyclic query, thus enabling parallel execution of large join queries. Finally, we prove that a simple algorithm by Hu et al. converts any connected left-deep linear plan of a γ-acyclic query into a join tree, allowing reuse of optimizers developed for binary joins.

Keywords and phrases:
Query Optimization, Join Trees, Enumeration
Funding:
Wim Van den Broeck: Wim Van den Broeck acknowledges support from the L. Meltzers Høyskolefond and the Research Council of Norway, grant number 326537.
Copyright and License:
[Uncaptioned image] © Zheng Luo, Wim Van den Broeck, Guy Van den Broeck, and Yisu Remy Wang; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Information systems Query optimization
; Theory of computation Database theory ; Mathematics of computing Graph theory
Related Version:
Extended report: https://arxiv.org/abs/2509.14144 [27]
Editors:
Balder ten Cate and Maurice Funk

1 Introduction

The query optimizer sits at the heart of a database system. It takes a query as input and generates a plan for efficient execution, allowing users to program declaratively without worrying about performance. Among the many relational algebra operators, join has received significant attention in optimization research. Its compositional nature allows for combining information from multiple relations, constructing complex queries from simple ones, and producing an output asymptotically larger than the inputs. The primary challenge is the join ordering problem to find the best arrangement of many join operations. Most existing research has focused on binary join algorithms such as hash join and sort-merge join, but these can produce unnecessarily large intermediates. Recent work has revived interest in optimal join algorithms, notably Yannakakis’ instance-optimal algorithm [42] for acyclic queries, which runs in linear time in the input and output size, 𝒪(|IN|+|OUT|). Its execution is guided by join trees whose nodes are relations, different from traditional binary join plans with relations at the leaves and join operators at the internal nodes. Although the algorithm is optimal regardless of the join tree, the choice of plan can affect practical performance. In this paper, we study the optimization problem in the context of Yannakakis-style algorithms.

A query optimizer typically has two parts: a plan generator and a cost model to assess each plan. This paper focuses on plan generation and presents three approaches:

  1. 1.

    Given the line graph L (Definition 6) of an α-acyclic query H, Algorithm 2 enumerates all join trees by edits111To avoid redundant work, enumeration by edits [22] outputs the difference between consecutive elements. with amortized constant delay, i.e., in 𝒪(|L|+k) where k is the number of trees generated (Theorem 27). If the query is γ-acyclic, Algorithm 4 further reduces the total time complexity to 𝒪(|H|+k) (Theorem 28).

  2. 2.

    Given a Berge-acyclic query, we prove that the classic Maximum Cardinality Search algorithm by Tarjan and Yannakakis [38] yields a unique shallowest join tree (Theorem 35), enabling parallel execution of very large queries.

  3. 3.

    Given a connected left-deep linear join plan for any γ-acyclic query, we prove that a simple algorithm by Hu et al. [20] always converts the plan into a valid join tree (Corollary 39), allowing reuse of existing optimizers.

The rest of the paper is organized as follows: Section 2 discusses related work; Section 3 introduces relevant concepts and notations; Section 4 presents the join tree enumeration algorithms; Section 5 introduces the unique shallowest join tree, namely the canonical join tree and its construction; Section 6 discusses the conversion from binary plans to join trees; Section 7 concludes the paper by pointing to avenues for future work. For easy reference, the key notations are summarized in Table 1. Additional technical details and proofs are provided in the extended report [27].

2 Related Work

Join order optimization is well studied, with algorithms based on dynamic programming (DP) from the bottom up [29, 33, 31], cost-based rewriting from the top down [11, 15], greedy heuristics [5, 14, 37], and randomized search [35]. Since the plan space is exponential, most methods prune it: some restrict to left-deep plans [21, 23], while others avoid Cartesian products [29, 30]. Our algorithms restrict the query plans to those running in linear time for acyclic queries. In particular, while avoiding Cartesian products requires each subplan to form a spanning tree of the corresponding subquery’s join graph,222The join graph of a query has a vertex for each relation and an edge for each pair of relations that join with each other. We later define this as the line graph of the query hypergraph in Definition 6. our algorithms find maximum spanning trees of the weighted join graph. Several algorithms for ordering binary joins are based on dynamic programming and tabulate shared structures among different plans [29, 30]. This is desirable because subplans are grouped into equivalence classes, and the optimal plan can be constructed in a bottom-up manner. Future work may explore constructing compact representations of join trees, suitable for dynamic programming.

Several recent papers have proposed practical implementations of Yannakakis’ algorithm for acyclic queries [2, 20, 40, 45]. For example, Zhao et al. [45] find that different query plans perform similarly, thanks to the optimality of Yannakakis’ algorithm. They adopt a simple heuristic to construct the join tree by picking the largest input relation as the root, and then greedily attaching the remaining relations into the tree. Inspired by this algorithm, we prove in Section 5 that for Berge-acyclic queries there is a unique shallowest join tree for any given root where the depth of each node is minimized. Furthermore, this tree can be constructed in linear time by Tarjan and Yannakakis’ Maximum Cardinality Search algorithm [38]. Shallow trees are desirable for parallel execution, where the depth of the tree determines the number of sequential steps. Other practical implementations of Yannakakis’ algorithm leverage existing optimizers for binary joins and convert a binary plan into a join tree [2, 20]. In particular, Hu et al. [20] find that every left-deep linear plan encountered in practice can be converted into a join tree by a simple algorithm. This is not surprising, as we will prove in Section 6 that every connected left-deep linear plan of a γ-acyclic query must traverse some join tree from root to leaves.

On the theoretical side, attention has been focused on finding (hyper-)tree decompositions to improve the asymptotic complexity of query processing [36, 19, 16]. The general goal is to find a decomposition with small width which can be used to guide the execution of join algorithms. Most algorithms find a single decomposition with minimum width to achieve the optimal asymptotic complexity [36, 19, 16]. Nevertheless, different decompositions with the same width may still lead to different performance in practice, and cost-based optimization remains crucial. For this, Carmeli et al. [6] propose an algorithm to enumerate tree decompositions with polynomial delay. In this paper, we focus on acyclic queries and their join trees, which are precisely the decompositions with width 1. Our enumeration algorithm can generate all join trees by edits with amortized constant delay.

3 Preliminaries

Table 1: Key notations introduced in Section 3 and Section 4.
Variable Definition
H,X=X(H),R=R(H) Hypergraph, its vertex set and hyperedge set
χ:R2X Incidence function mapping each hyperedge to its vertices
|H| Size of hypergraph: |H|=rR|r|
H|x Neighborhood of x in H: set of hyperedges containing x
H,X,χ Equivalent hypergraph, its vertices, and incidence function
G,R=R(G),E=E(G) (Multi-)graph, its nodes (corresponding to hyperedges) and edges
ρ:E2X,ω:E Incidence function mapping each edge to its endpoints, weight function
G,ρ Equivalent graph (Def. 15) and its incident function
GTG G can be slid into G (Def. 16)
L=L(H),χ(e),ω(e) Line graph of H, edge label χ({r1,r2})=r1r2, weight ω(e)=|χ(e)|
|L| Size of line graph: |L|=eE(L)ω(e)
G|x Subgraph of GL(H) induced by H|x
Tr,T^r A join tree (JT) and a monotonic weight JT (Def. 20) rooted at r
𝒯(L(H))=𝒯(H) Set of (unrooted) join trees of L(H) and also of H
0pt(Tr,ri) Depth of node ri in the rooted tree r
p(),c(),s() Parent, children and siblings of a node or an edge in a rooted tree
𝖫𝖢𝖠(ri,rj),𝖫𝖠(ri,d) Lowest common ancestor of ri, rj and level ancestor of ri at depth d
λ(e) LCA edges of a non-tree edge e=(ri,rj)

We focus on full conjunctive queries [1] in this paper and identify each query with its hypergraph, where each vertex represents a variable and each hyperedge represents a relation. Table 1 summarizes key notations introduced throughout the paper.

Definition 1 (Hypergraph).

A hypergraph H=(X,R,χ) consists of a set of vertices X, a set of hyperedges R and an incidence function χ:R𝒫(X).

We only consider hypergraphs without isolated vertices, empty hyperedges or duplicated hyperedges over the same set of vertices. We assume each hyperedge r contains a bounded number (𝒪(1)) of vertices exclusive to r. When there is no ambiguity, we will use r interchangeably with χ(r), xr with xχ(r), and H(X,R) with H(X,R,χ). We will also apply common set operations directly to hyperedges, e.g., r1r2 for χ(r1)χ(r2).

In fact, the reader can often ignore χ and identify a hyperedge with its set of vertices; the purpose of χ is to relate hyperedges over different vertex sets across hypergraphs in the correctness proofs of our algorithms.

We write X(H) and R(H) to refer to the vertices and edges of H respectively. The size of a hypergraph is the total size of all hyperedges |H|=rR|r|. We let H|x denote the neighborhood of xX, consisting of all hyperedges containing x.

Definition 2 (Multigraph).

A multigraph G=(R,E,ρ) consists of a set of vertices R, a set of edges E, and the incidence function ρ:E𝒫(R) such that 1|ρ(e)|2 for any eE. An edge e is a self-loop if |ρ(e)|=1. Edges e1,e2E are parallel if ρ(e1)=ρ(e2).

We denote the set of vertices in G with R, because we will soon define the line graph L of a hypergraph where each vertex in L represents a hyperedge. We write R(G) and E(G) to refer to the vertices and edges of G respectively.

Definition 3 (Simple Graph).

A simple graph is a multigraph with no parallel edges or self-loops, i.e., the incidence function is injective and always returns two distinct vertices.

Because each edge e in a simple graph can be identified with its two endpoints ρ(e)={r1,r2}, we will omit ρ and write {r1,r2} for e when there is no ambiguity.

Definition 4 (Cycle, Clique and Diamond).

In a simple graph G=(R,E), a sequence of n3 distinct vertices (v0,,vn1) where viR is

  • a cycle if there is an edge between vi and v(i+1)modn for all 0in1;

  • an n-clique Kn if the induced graph G|{v0,,vn} has an edge between each pair of vertices;

  • a diamond if n=4 and G|{v0,,v3} has one fewer edge than a K4.

A weighted graph is a (multi-)graph where each edge is assigned a weight:

Definition 5 (Weighted Graph).

A weighted graph (G,ω) consists of a multigraph G=(R,E,ρ) and weight function ω:E assigning a natural number to each edge in G.

The line graph of a hypergraph is the “intersection graph” of its hyperedges:

Definition 6 (Line Graph).

For a hypergraph H, the line graph L(H)=(G,χ) consists of a simple graph G=(R,E) and an edge labeling function χ:E𝒫(X). The vertices of G are the hyperedges R of H, and there is an edge e={r1,r2}E when r1r2. The edge labeling function maps each edge e to the intersection of the hyperedges represented by the endpoints of e: χ({r1,r2})=r1r2.

In addition, we define a weight function mapping each edge to the size of its label:

Definition 7 (Line Graph Edge Weight).

For each edge eE(L(H)), the weight function ω:E(L(H)) is defined as ω(e)=|χ(e)|.

When there is no ambiguity from the context, we simply write L(H) as L, and we may treat the line graph (G,χ) as a weighted graph (G,ω). The size of a line graph is the sum of all edge weights |L|=eE(L)ω(e). For any subgraph G of L(H), we let G|x denote the subgraph of G induced by H|x.

Algorithm 1 MCS from rR(H).
(a) Hypergraph H6.
(b) Line graph L6.
(c) TG by GYO.
(d) TM by MCS.
Figure 1: A hypergraph H6, its line graph L6, and two join trees TG and TM.
Example 8.

Figure 1(a) shows an example hypergraph of size 14. The line graph L6=L(H6) is shown in Figure 1(b). For instance, hyperedges Y and U share two vertices a and d, so they are connected by an edge in the line graph. The edge weight is given by ω({Y,U})=|{a,d}|=2. Each unannotated edge in L6 connects two hyperedges sharing only the vertex a. Otherwise, the common vertices shared by a pair of hyperedges are annotated next to the corresponding edge. The size of the line graph is |L6|=19.

Definition 9 (Join Tree).

A join tree T of hypergraph H is a spanning tree of L(H) such that T|x is a connected subtree for each xX(H). If a certain vertex is specified as the root, T becomes a rooted join tree.

We use R(T) to denote the set of nodes and E(T) to denote the set of edges of tree T. The requirement that T|xX(H) be a connected subtree is also known as the running intersection property [13]. We write 𝒯(L(H)) or 𝒯(H) to denote the set of unrooted join trees of H. We use Tr to denote a join tree rooted at rR(T). When there is no ambiguity, we simply write T. The depth of a node ri in the rooted tree Tr, denoted 0pt(Tr,ri), is defined as its distance from the root.

Four common notions of hypergraph acyclicity are defined in increasing order of strictness [13], namely α-acyclic β-acyclic γ-acyclic Berge-acyclic.

Definition 10 (Hypergraph Acyclicity).

A hypergraph H is:

  • α-acyclic if it admits a join tree as in Definition 9;

  • β-acyclic if every subgraph of H is α-acyclic;

  • γ-acyclic if it does not contain any γ cycle. A γ cycle is a sequence of length k3 of distinct hyperedges and distinct vertices (r0,x0,,rk1,xk1) such that every xi[0,k2] belongs to riri+1 and no other rj while xk1 belongs to rk1r0 and possibly other hyperedges;

  • Berge-acyclic if it does not contain any Berge cycle. A Berge cycle is a sequence of length k2 of distinct vertices and distinct hyperedges (r0,x0,,rk1,xk1) such that i[k]:xirir(i+1)modk.

The following classic result relates join trees of H to maximum spanning trees of L(H):

Theorem 11 (Maier [28]).

Given an α-acyclic hypergraph H=(X,R), a tree with nodes in R is a join tree of H if and only if it is a maximum spanning tree (MST) of L(H).

Join trees for acyclic hypergraphs can be constructed by GYO reduction:

Definition 12.

A GYO reduction order is a sequence of hyperedges r1,r2,,rk such that for each ri<k, there is some rp>i, called the parent of ri, such that rj>i:rirjrp.

The GYO reduction algorithm [43] finds such an order iteratively, and attaches each hyperedge to its parent to form a join tree. It generates the join tree TG as shown in Figure 1(c), where, for example, the node T is the parent of W, denoted as p(W)=T and the root P has no parent.

Another way to construct join trees is via the Maximum Cardinality Search (MCS) algorithm [38], and we present a simplified version in Algorithm 1. The join tree produced by the algorithm is called an MCS tree. Given an input hypergraph H and a hyperedge rR(H) chosen as the root, Algorithm 1 constructs a rooted MCS tree by iteratively expanding toward hyperedges connected with those already processed. The algorithm maintains a set R of unprocessed hyperedges and a set X of unvisited vertices. Initially, the MCS tree contains no edges, and the first hyperedge to be processed is the root r. In each iteration, the algorithm processes the current hyperedge r by examining all of its unvisited vertices in rX. Whenever such a vertex x is encountered, every remaining hyperedge rR that contains x records r as its tentative parent p(r)r. Once all vertices of r are marked as visited, they are removed from X. The hyperedge r is marked as processed and removed from R. After processing each r, the edge between r and its recorded parent p(r) is added to the MCS tree as {r,p(r)}. The algorithm selects as the next hyperedge an element of R that maximizes the number of already visited vertices, namely a hyperedge r that maximizes |rX|, breaking ties arbitrarily. This process continues until all hyperedges have been processed, when the recorded edges {r,p(r)} form an MCS tree rooted at r.

Example 13.

On H6 in Figure 1(a) with r=P, Algorithm 1 examines all vertices of P. P also becomes the tentative parent of five hyperedges, p(S)=p(T)=p(U)=p(W)=p(Y)P. It proceeds to check the next hyperedge with the most visited vertices as in Line 9. At this point, each of the five has one visited vertex, Algorithm 1 breaks the tie arbitrarily, say proceeding with S, and examining all its vertices. Its parent is finalized as p(S)=P. Each of the remaining four again has one visited vertex, so Algorithm 1 proceeds to check T. Its parent is finalized as p(T)=P. While checking T, Algorithm 1 examines the vertex c that is also in U,W, their parents are updated to p(U)=p(W)T. It continues until all hyperedges are processed. By connecting each hyperedge with its parent, Algorithm 1 constructs the MCS tree TM in Figure 1(d).

Algorithm 1 can generate different join trees by varying the choice of root and tie-breaking strategy. However, it does not guarantee to generate all possible trees. For example, it never generates the join tree TG shown in Figure 1(c).

We extend the notions of parent, children and siblings to edges of a rooted tree. Let eE(T) be an edge of tree T rooted at r (and e not incident to r). Its parent p(e)E(T) is the unique tree edge incident to e and closer to the root r. We let c(e) denote the set of children of e in T. The siblings of e are the set of edges incident to the parent of e, namely s(e)={eE(T){e}p(e)=p(e)}. Edges incident to the root do not have a parent and are all siblings.

Lemma 14 shows that an MCS tree is “somewhat monotonic” in that every edge must contain some variable not in its parent. If two edges share any variable not in their parents, they must be siblings.

Lemma 14.

Let T be an MCS tree. For an edge eT that has a parent, then

  1. 1.

    ep(e)

  2. 2.

    For another edge eT:(ep(e))(ep(e))p(e)=p(e).

Computation model.

Throughout the paper we assume the Random Access Machine model of computation, where one can allocate an array of size n in 𝒪(n) time. Constant-time operations include accessing and updating an array element, adding or deleting an element in a linked list, and the common arithmetic operations on integers.

4 Enumerating Join Trees

Our strategy for enumerating the join trees of a hypergraph H starts from Theorem 11 which allows us to reduce the problem to the enumeration of maximum spanning trees (MSTs) of the line graph L(H). The best known algorithm for MST enumeration333Eppstein focuses on minimum spanning trees, but the same algorithm applies to maximum spanning trees with flipped comparisons. is due to Eppstein [12] by deriving from the input graph G a so-called equivalent graph G. Every spanning tree of G corresponds to an MST of G and vice versa. Eppstein gives an algorithm (and proves a matching lower bound) in time 𝒪(m+nlogn) to construct the equivalent graph from an arbitrary weighted graph with m edges and n vertices. Then to enumerate all k MSTs of G, he applies existing algorithms to enumerate the spanning trees of G. Since there are optimal spanning tree enumeration algorithms that run in 𝒪(m+n+k) time [22, 34], the overall time complexity to enumerate MSTs is 𝒪(m+nlogn+k). The main result of this section is an algorithm for enumerating join trees leveraging the structure of acyclic hypergraphs and their line graphs. In particular:

  • Given the line graph L of an α-acyclic hypergraph, we can construct an equivalent graph of L in 𝒪(|L|), thus enumerating the join trees in 𝒪(|L|+k) time (Theorem 27).

  • Given any γ-acyclic hypergraph H, we can construct an equivalent graph of L(H) in 𝒪(|H|), lowering the overall time complexity of enumeration to 𝒪(|H|+k) (Theorem 28).

Note that |L(H)| can be quadratic in |H| while |H|𝒪(|L(H)|), so the second item above yields a better bound.

In the rest of this section, we first define the equivalent graph. Then, we present the algorithm for enumerating join trees of α-acyclic hypergraphs. Finally, we adapt the algorithm to enumerate join trees of γ-acyclic hypergraphs more efficiently.

4.1 Equivalent Graph

The key idea of Eppstein’s algorithm [12] is to construct an equivalent graph G whose spanning trees one-to-one correspond to the MSTs of the input graph G, thereby reducing MST enumeration to spanning tree enumeration.

Definition 15 (Equivalent Graph [12]).

Given a weighted graph G=((R,E,ρ),ω), a multigraph G=((R,E,ρ),ω) is an equivalent graph of G if the spanning trees of G one-to-one correspond to the maximum spanning trees of G: a set of edges ETE induces a spanning tree of G if and only if ET induces an MST of G.

In what follows, we may use the notation G(L(H)) or G(H) to refer to an equivalent graph of the line graph of hypergraph H. Note that G shares the same vertices and edges of G, and they only differ in the incidence function mapping each edge to its endpoints. Such an equivalent graph can be constructed from G by applying a series of sliding transformations: for two incident edges e,e with ρ(e)={r1,r2} and ρ(e)={r2,r3}, we can slide e along e by updating ρ(e)={r1,r3}, if ω(e)<ω(e). Note that the edge e retains its identity after sliding, which explains the need for the incidence function ρ. Furthermore, we will use a given rooted MST T as a guide, and only slide edges towards the root. More formally:

Definition 16 (Sliding Transformation [12]).

Let T be a MST of G rooted at r. Let e be an edge such that ρ(e)={r1,r2} with r1 closer to the root than r2 in T. If another edge e shares r2 with e, i.e., ρ(e)={r2,r3}, and ω(e)<ω(e), then sliding e along e results in a graph G that is identical to G, except that the incidence function maps e to {r1,r3}.

The key result by Eppstein shows that applying sliding transformations on G along a rooted MST T to a fixpoint results in an equivalent graph of G. To state this formally, we first define an ordering on graphs based on sliding transformations. It is easy to verify the following is a partial order:

Definition 17 (Sliding Partial Order).

We write GTG if G can be obtained from G by applying a sequence of sliding transformations along a rooted MST T of G.

Applying sliding transformations to a fixpoint therefore yields a maximal element under the sliding partial order.

Theorem 18 (Sliding produces G at fixpoint [12]).

Given a weighted graph G and a rooted MST T, and let G be a maximal element under T. Then G is an equivalent graph of G.

The choice of the initial rooted MST can affect the structure of the equivalent graph, but the order of sliding transformations performed has no impact [12].

(a) TW.
(b) 3 Edges Slid.
(c) G.
(d) TW.
Figure 2: TW is an MST of the line graph in Figure 1(b) where the black solid lines stand for the tree edges, the dashed line for an MST edge (S,U), the dotted line for a non-MST edge (T,Y) and gray solid lines for the remaining non-tree edges. G is the resulting equivalent graph where the thick lines highlight the parallel edges.
Example 19.

Given the 6-clique line graph L6 in Figure 1(b), we find a rooted MST TW as shown in Figure 2(a). Among all the tree edges shown as black solid lines, we can only apply the sliding transformation to the edge {T,P} whose weight ω({T,P})=|{a}|=1 is lighter than its parent tree edge {W,T} with ω({W,T})=|{a,c}|=2. We slide along the tree edge {W,T} to the root so that the edge {T,P} becomes {W,P} as shown by the solid curve in Figure 2(b). Non-tree edges can slide similarly. We consider two examples, {S,U} illustrated with a dashed line and {Y,T} with a dotted line in Figure 2(a). All other non-tree edges are shown in light gray. We can slide {S,U} along tree edge {U,W} to become {S,W} as shown by the dashed curve in Figure 2(b). Both ends of {Y,T} can slide along the tree edges to the root so that the edge becomes a self-loop as shown by the dotted loop in Figure 2(b). This edge will not appear in any spanning tree of L6, and therefore not a part of any MST of L6. We refer to such an edge as a non-MST edge, as opposed to an MST edge. Denoting the graph after sliding as L6, ordering L6TWL6 holds. By applying sliding transformations to a fixpoint, we obtain an equivalent graph L6, where there are two sets of parallel edges highlighted by thick lines in Figure 2(c) (self-loops are omitted). For example, the tree edge {T,P} in TW and non-tree edges {P,U},{P,T},{P,Y} become parallel in L6 between P and W. Therefore L6TWL6TWL6 holds under the sliding partial order. We can easily verify that each spanning tree of L6 corresponds to an MST of L6, such as TW in Figure 2(d).

4.2 Enumerating Join Trees of 𝜶-Acyclic Hypergraphs

The bottleneck of Eppstein’s algorithm for constructing equivalent graphs of arbitrary weighted graphs lies in a subroutine that identifies where each edge will eventually slide to. Because each edge can only slide along a heavier edge, it will eventually be “blocked” by a lighter or equally weighted edge along its path to the root. The subroutine essentially performs binary search to find the blocking edge, leading to the logn factor in the overall complexity. The key to our improvement is to show that for every acyclic hypergraph H, we can construct an equivalent hypergraph H whose join trees one-to-one correspond to those of H, but one special join tree of H has monotonically increasing weight from root to leaf, which enables constant-time identification of the blocking edge.

Definition 20.

A monotonic weight join tree T^𝒯(H) is a rooted join tree of H such that for any eE(T^) that has a parent edge p(e), ω(e)>ω(p(e)).

We can always construct such a H given any α-acyclic hypergraph H:

Theorem 21.

Given an α-acyclic hypergraph H=(X,R,χ), there exists an equivalent hypergraph H=(X,R,χ) over the same hyperedge set R that

  • admits a monotonic weight join tree T^𝒯(H), and

  • 𝒯(H)=𝒯(H).

(a) H6.
(b) T^p.
(c) T^p with 3 non-tree edges.
Figure 3: An equivalent hypergraph H6 and its monotonic weight join tree T^P rooted at P.
Example 22.

H6 in Figure 3(a) is a hypergraph with similar structure to H6 in Figure 1(a). H6 differs from H6 by one vertex d and admits the same set of join trees. Therefore, finding an equivalent graph G(L(H6)) is sufficient for enumerating the join trees of H6. H6 also admits a monotonic weight join tree T^P in Figure 3(b).

A monotonic weight join tree T^ can accelerate the construction of the equivalent graph in several ways. First, all tree edges are already “in place”, because they cannot slide along their lighter parent edges. We therefore need only consider non-tree edges. For each non-tree edge e={ri,rj}, there are two possible cases. First, if one endpoint, say ri, is an ancestor of the other, say rj, then e can only slide to become parallel to the edge right below ri on the path connecting ri and rj in T^. This is because all edges on that path must be no lighter than e due to the running intersection property of join trees, but since T^ has monotonically increasing weight, at most one edge (the one right below ri) can have equal weight to e. If this edge has weight equal to e, it becomes the blocking edge, and e slides to become parallel to it; otherwise, e slides to a self-loop at ri. In the second case, if neither endpoint is an ancestor of the other, there are at most two blocking edges, namely those below the lowest common ancestor of ri and rj on the path between them. We therefore only need to compare the weight of e with these two potentially blocking edges to determine the destination of e.

Algorithm 2 buildEG.
(a) MCS Tree TP(H6).
(b) 3 Non-tree Edges Processed.
(c) Equivalent Graph G(H6).
Figure 4: Algorithm 2 on H6 of Figure 1(a)
Example 23.

Consider again T^p in Figure 3(c). First note that every tree edge is heavier than its parent edge, and each non-tree edge is no heavier than any edge on the path connecting its endpoints in the tree. There is one edge, {T,Y}, where one endpoint (T) is an ancestor of the other (Y). The only potentially blocking edge is {T,U} right below T. But because {T,U} is heavier, {T,Y} slides to become a self-loop at T. For the edge {W,Y}, all edges on the tree path connecting the endpoints are heavier, so {W,Y} also slides to a self-loop at their LCA T. Finally, {Y,S} is blocked by the two edges {P,T} and {P,S} below their LCA P, as all three edges have a weight of 1. Therefore {Y,S} slides to {T,S}.

Our algorithm for constructing the equivalent graph leverages the insight above to slide each edge in constant time. In the following, we first define a few helpful notations and describe a preprocessing step to build helper data structures, before presenting the algorithm.

Given a rooted MCS tree Tr of a line graph L, a non-tree edge is e={ri,rj}E(L)E(Tr). There is a path in Tr between ri and rj via their lowest common ancestor 𝖫𝖢𝖠(ri,rj). We define the LCA edges λ(e)=λ(ri,rj) as a set of at most two tree edges on the path and incident to 𝖫𝖢𝖠(ri,rj). If ri, rj are ancestor and child, then |λ(e)|=1, otherwise, |λ(e)|=2.

During pre-processing, we first conduct a breadth-first search on Tr to obtain the depth table 0pt of each tree node in 𝒪(|Tr|). Then we build two data structures in 𝒪(|Tr|) to facilitate the constant-time query of the lowest common ancestor (LCA) [3] given two nodes, and the level ancestor (LA) [4] of a node r, which is the ancestor of r at a given depth. Algorithm 2 assumes these data structures are prebuilt and available, which allows finding λ(e) of any non-tree edge e in constant time as follows:

λ({ri,rj})={{{ri,𝖫𝖠(rj,0pt(ri)+1)}}if ri=𝖫𝖢𝖠(ri,rj){{rj,𝖫𝖠(ri,0pt(rj)+1)}}if rj=𝖫𝖢𝖠(ri,rj){{l,𝖫𝖠(ri,d)},{l,𝖫𝖠(rj,d)}}otherwise, l:=𝖫𝖢𝖠(ri,rj),d:=0pt(l)+1

We are now ready to present Algorithm 2 which constructs G by sliding each non-tree edge e={ri,rj} with weight ω. There are two cases. First, if λ(e) returns a single edge, then one endpoint is an ancestor of the other. By the definition above λ(e) always returns the ancestor node l first, while the other node is denoted as l. The weight of {l,l} is then compared with ω: if ω is lighter, e slides to a self-loop at l; otherwise the weights must be equal, and e slides to be parallel to {l,l}. Second, if λ(e) returns two edges, then neither endpoint is an ancestor of the other. In this case we compare ω with the two edges in λ(e). If ω is lighter than both, e slides to a self-loop at l; if ω equals one of them, e slides to be parallel to that edge; otherwise, ω equals both, and e slides to be incident to each of the highest depth endpoints of both edges. The four cases are exhaustive, as the non-tree edge never outweighs any of its LCA edges by the running intersection property.

Theorem 24.

Given a hypergraph H=(X,R,χ) with a monotonic weight join tree T^, Algorithm 2 produces an Equivalent Graph G(L(H)).

The notation H highlights later applications to equivalent hypergraphs, although Theorem 24 applies to any hypergraph admitting a monotonic weight join tree.

Although Algorithm 2 constructs an equivalent graph of L(H) in constant time per edge, such an H may be asymptotically larger than H. Perhaps surprisingly, running Algorithm 2 directly on H produces the same equivalent graph! This is because H is constructed in a way that preserves the structure of H, keeping the relative weights of an edge and its LCA edges invariant. Intuitively, we construct H by making “local copies” of the vertices in H: this perturbs the weights to be monotonic along T^, while ensuring the weights are adjusted consistently. In particular, when making a new copy x of a vertex x, we add x to all hyperedges that contain x, namely H|x. This way, χ(e)χ(e) in L(H) if and only if χ(e)χ(e) in L(H). As a result, all comparisons in Algorithm 2 return the same result when running on H or H. We illustrate this with the following example.

Example 25.

In Figure 3(a), we made a copy d of d and added it to all hyperedges containing d in H6. This maintains the relative weights between the tree edge {U,Y} and the non-tree edges highlighted in Figure 3(c): all three non-tree edges remain lighter than {U,Y}. Were we to make a copy of a to add to H6|a (which contains every hyperedge in H6), the weights of the non-tree edges relative to their respective LCA edges would also remain unchanged.

Finally, because H and H share the same join trees, there must be G(L(H)) that is the same as G(L(H)). Together with Theorem 24, this means running Algorithm 2 directly on L(H) produces an equivalent graph G(L(H)) of L(H):

Theorem 26.

Given the line graph L and an MCS tree Tr of an α-acyclic hypergraph H, Algorithm 2 returns an equivalent graph G(L) in time 𝒪(|L|).

Figure 4 shows an example of applying Algorithm 2 to H6 in Figure 1(a). Once we compute the equivalent graph G(L), we can apply existing algorithms [22, 34] to enumerate all its spanning trees by edits with amortized constant delay. And because the MCS tree can be constructed in linear time from H which in turn can be recovered from L(H) in linear time, the overall time complexity of enumerating all join trees of H is linear in the size of L plus the number of join trees:

Theorem 27.

Given the line graph L of an α-acyclic hypergraph H, the join trees of H can be enumerated in time 𝒪(|L|+|𝒯(H)|).

4.3 𝜸-Acyclic Queries

Algorithm 3 MCS (γ-acyclic).
Algorithm 4 buildEG (γ-acyclic).

The run time of Algorithm 2 depends on the size of the line graph which can be quadratically larger than the input hypergraph. If H is γ-acyclic, we can bring the total time complexity of enumeration down to 𝒪(|H|+|𝒯(H)|). Using an algorithm by Leitert [25], we can construct L(H) from H in time 𝒪(|H|+|L(H)|) when H is γ-acyclic; furthermore, because every edge in L(H) of a γ-acyclic H is an MST edge [25], we have |H|+|𝒯(H)|Ω(|L(H)|), and so 𝒪(|H|+|L(H)|+|𝒯(H)|)=𝒪(|H|+|𝒯(H)|), hiding the |L(H)| term in the overall complexity. However, the L(H) constructed by Leitert is unweighted, so we need to modify Algorithm 2 slightly to slide each non-tree edge based on the weights of its LCA edges alone. We first modify MCS (Algorithm 1) to track the weight of each tree edge as in Algorithm 3. Then, we update the cases of Algorithm 2 to those in Algorithm 4. First, if λ(e) returns a single edge, we directly slide e to be parallel to it, because we know e is an MST edge and therefore will not become a self-loop. Otherwise, if λ(e) returns two edges, we compare the weights of those two edges, instead of comparing them with ω(e). This is again because we know e is an MST edge, so it must have weight equal to at least one of its LCA edges. If one of the LCA edges is lighter, e must have equal weight to that edge, and we slide e to be parallel to it. Otherwise, if both LCA edges have the same weight, e must also have the same weight, and we slide e to be under both edges to form a triangle. In all cases we only use the weights of the tree edges and do not need to know ω(e).

Theorem 28.

The join trees of a γ-acyclic H can be enumerated in time 𝒪(|H|+|𝒯(H)|).

5 The Canonical Join Tree of a Berge-Acyclic Query

An acyclic query can have exponentially many join trees with respect to its size. For example, the line graph of a clique query with n relations is an n-clique Kn with nn2 join trees by Cayley’s formula [7]. Enumerating all join trees can be prohibitive for large queries. The query optimizer does not need to consider all possible join trees to achieve good performance. For example, the implementation of Yannakakis’ algorithm by Zhao et al. [45] achieves similar performance on any join tree rooted at the largest relation. An alternative to enumeration is therefore to simply construct one join tree for a given root. This can be done in linear time by the Maximum Cardinality Search (MCS) algorithm from a chosen relation as shown in Algorithm 1. In this section, we prove that for a Berge-acyclic query the MCS algorithm produces a shallowest tree, where the depth of each tree node is minimized. We prove that this shallowest tree is unique, and therefore call it the canonical join tree.

Definition 29.

A join tree Tr rooted at r is canonical if 0pt(Tr,ri)0pt(Tr,ri) for any other join tree Tr rooted at r and any riR(Tr)=R(Tr).

A shallow join tree has practical benefits. For example, the depth of the join tree determines the number of sequential steps required in a parallel join algorithm. A shallow join tree also tends to be wide and have more leaves, allowing better utilization of indices.

Although Berge-acyclicity was thought to be too restrictive when it was first introduced to database theory [13], we found it to be general enough to cover almost all acyclic queries encountered in the wild. As shown in Table 2, among 10 454 queries from five popular benchmarks, 9285 are α-acyclic, and only 8 of these are not Berge-acyclic. In retrospect, this should not be surprising, as most joins in relational databases are over primary/foreign keys. Emerging workloads in graph databases usually involve simple graphs and seldom require composite key joins. A query without composite key joins admits a linear hypergraph, where each pair of hyperedges shares at most one vertex. The following result establishes an equivalence between α-acyclicity with linearity and Berge-acyclicity.

Table 2: Acyclic queries in the benchmarks (all α-acyclic queries are also γ-acyclic.).
Name # Queries # α-Acyclic # Composite-Key Joins # Berge-Acyclic
TPC-H[39] 22 21 2 19
JOB[24] 113 113 0 113
STATS-CEB[17] 2603 2603 0 2603
CE[8] 3004 1839 0 1839
Spider-NLP[44] 4712 4709 6 4703
Proposition 30.

An α-acyclic hypergraph is Berge-acyclic if and only if it is linear.

By Proposition 30, every edge in the line graph of a Berge-acyclic hypergraph has a weight of 1. Every spanning tree is a maximum spanning tree, therefore a join tree.

Corollary 31.

For a Berge-acyclic hypergraph H, any spanning tree of L(H) is a join tree.

In the rest of this section, we prove the existence and uniqueness of the canonical join tree rooted at any relation of a Berge-acyclic hypergraph, and show that it can be constructed by MCS as in Algorithm 1.

The key insight leading to the existence and uniqueness of the canonical join tree is that the line graph L of a Berge-acyclic hypergraph is geodetic [32], meaning that there is a unique shortest path between any pair of vertices. The canonical join tree can then be constructed by taking the union of all shortest paths from the root to each other vertex, as this will guarantee minimal depth for each vertex. The key step to establish the geodetic property is to show that L is a special class of chordal graphs called block graphs. Chordal graphs are intimately related to acyclic hypergraphs [9], and a block graph is a special chordal graph defined as follows:

Definition 32 (Chordal and Block).

A simple graph G=(R,E) is

  • chordal [10] if every cycle of length at least 4 has a chord, i.e., an edge that is not part of the cycle but connects two vertices of the cycle;

  • a block graph [18] if it is chordal and diamond-free, i.e., no subgraph induced by any RR is a diamond (Definition 4).

Lemma 33.

The line graph L of a Berge-acyclic hypergraph H is a block graph.

Together with the fact that every block graph is geodetic (with a unique shortest path between any two vertices) [32], Lemma 33 implies the following corollary.

Corollary 34.

Let L be the line graph of a Berge-acyclic hypergraph H. There is a unique shortest path between any two vertices in L.

We are now ready to prove the existence and uniqueness of the canonical join tree.

Theorem 35.

A Berge-acyclic hypergraph H has a unique canonical tree.

Proof.

Let L be the line graph of H, and 𝖯(r,r) be the shortest path in L between r,rR(L), we prove that Tr=rR(L)𝖯(r,r) is the unique canonical join tree for H rooted at r.

By Corollary 31 any spanning tree of L is a join tree. Tr is connected and spans all vertices in R(L), because it contains the shortest path from r to every rR(L). It remains to show that Tr is acyclic, which we prove by induction on the distance 𝖽𝗂𝗌𝗍(r,r) between r and r. Let Rd={rR(L)𝖽𝗂𝗌𝗍(r,r)d}. R0={r} contains only the root. The subgraph Tr|R0 is trivially acyclic. Assuming that Tr|Rd>0 is acyclic, we consider a vertex rRd+1Rd. Corollary 34 guarantees a unique shortest path between each pair of vertices r,rR(L). Each r is connected to a unique neighbor r′′RdRd1 that is at distance d from r. Otherwise, there are at least two distinct shortest paths from r to r. Therefore Tr|Rd+1 is acyclic, and Tr is a spanning tree thus a join tree of H.

The join tree Tr is canonical, because the path from r to each rR(L) is the shortest and therefore minimizing the depth 0pt(Tr,r). The canonical tree is unique by Corollary 34.

The canonical join tree can be constructed by the MCS algorithm as shown in Algorithm 1:

Theorem 36.

Given a Berge-acyclic hypergraph H, running Algorithm 1 from rR(H) constructs the canonical tree Tr(H).

6 Converting a Binary Join Plan to a Join Tree

Algorithm 5 Binary-to-JT Conversion.
Figure 5: Algorithm 5 [20] on JOB-3a [24].

Recent approaches [20, 2] that convert a binary join plan into a join tree have gained popularity as they allow system builders to leverage existing query optimizers designed for binary join plans. In this section, we focus on an algorithm by Hu et al. [20] to convert left-deep linear join plans into join trees as shown in Figure 5. We prove that the algorithm converts any connected left-deep linear join plan into a join tree if and only if the query is γ-acyclic. This can be seen as a new characterization of γ-acyclic queries. We formally define binary join plans and describe the algorithm by Hu et al. in Algorithm 5.

Definition 37.

A left-deep linear plan is a sequence of hyperedges (r1,r2,,rn). It is connected if for each ri2, rj<i:rirj.

Query optimizers strive to produce connected plans, to avoid expensive Cartesian products. Many optimizers produce exclusively left-deep linear plans. Plans that are not left-deep are called bushy, and such plans may still be decomposed into left-deep fragments [41].

Given a left-deep linear plan, Hu et al. [20] generate a join tree with Algorithm 5. The algorithm chooses the first relation r1 as the root and iterates through the rest of the plan. For each relation ri[2,n], it finds the first relation rj that contains all attributes shared by ri with all previous relations, key:=rik<irk, and assigns rj as the parent of ri. The algorithm constructs a join tree if it finds a parent for each ri.

Hu et al. [20] proved that the algorithm succeeds whenever the input plan is the reverse of a GYO-reduction order. They also observed that every left-deep linear plan produced for queries in standard benchmarks is indeed the reverse of a GYO-reduction order. This is not a coincidence, as we show that every connected left-deep linear join plan must be the reverse of a GYO-reduction order if and only if the query is γ-acyclic.

Theorem 38.

A query is γ-acyclic if and only if every connected left-deep linear join plan for the query is the reverse of a GYO-reduction order.

Immediately following Theorem 38, we can conclude the following.

Corollary 39.

For any γ-acyclic query, Algorithm 5 converts a given connected left-deep linear join plan to a join tree.

7 Conclusion and Future Work

(a) H3.
(b) TS(H3).
(c) H5.
(d) TW(H5).
(e) TW(H5).
Figure 6: H3 is not Berge-acyclic but admits a unique canonical join tree TS(H3) with any relation chosen as root, such as TS(H3). H5 is γ-acyclic and does not admit unique canonical join trees at any relation chosen as root. For example, TW(H5) and TW(H5) are MCS trees generated by Algorithm 1. Neither of them is a canonical join tree rooted at W.

We proposed three approaches for constructing join trees. Our enumeration algorithm in Section 4 generates join trees by edits with amortized constant delay; in Section 5, we showed that the Maximum Cardinality Search algorithm constructs the unique shallowest join tree for any Berge-acyclic query; in Section 6, we characterize the class of binary join plans that can be converted to join trees. Practitioners can choose from the three approaches to integrate instance-optimal algorithms into their system: a cost-based optimizer can use our enumeration algorithm to generate candidate query plans; a system aiming to support very large queries can implement the MCS algorithm to generate shallow join trees to improve parallelism; and a more conservative extension can derive join trees using existing optimization infrastructure, while our final result guarantees the validity of the output.

Future work includes compact representations of join trees for dynamic programming, as in binary plan optimizers, and the challenging cost estimation for Yannakakis-style algorithms: the random-walk approach [26] models joint probabilities for binary joins, whereas an efficient and accurate solution for semijoins remains to be found.

Our work also raises further theoretical questions. Can join tree enumeration achieve worst-case constant delay? We proved Berge-acyclicity sufficient for the existence and uniqueness of the canonical join tree, but it is not necessary, and γ-acyclicity is insufficient as shown in Figure 6. What is the precise characterization of hypergraphs that admit a unique canonical join tree for any root, or for some root? How can our algorithms be extended to enumerate tree decompositions à la Carmeli et al. [6]? One possible direction is to further develop connections between MSTs of the line graph and tree decompositions of the hypergraph. For example, we are considering using the determinants of the line graph Laplacian as heuristics to guide the search for good tree decompositions.

References

  • [1] Serge Abiteboul, Richard Hull, and Victor Vianu. Foundations of Databases. Addison-Wesley, 1995. URL: http://webdam.inria.fr/Alice/.
  • [2] Liese Bekkers, Frank Neven, Stijn Vansummeren, and Yisu Remy Wang. Instance-optimal acyclic join processing without regret: Engineering the yannakakis algorithm in column stores. Proc. VLDB Endow., 18(8):2413–2426, 2025. URL: https://www.vldb.org/pvldb/vol18/p2413-vansummeren.pdf.
  • [3] Michael A. Bender and Martin Farach-Colton. The lca problem revisited. In LATIN 2000, volume 1776 of Lecture Notes in Computer Science, pages 88–94. Springer, 2000. doi:10.1007/10719839_9.
  • [4] Michael A. Bender and Martin Farach-Colton. The level ancestor problem simplified. Theoretical Computer Science, 321(1):5–12, 2004. doi:10.1016/J.TCS.2003.05.002.
  • [5] Nicolas Bruno, César A. Galindo-Legaria, and Milind Joshi. Polynomial heuristics for query optimization. In Proceedings of ICDE 2010, pages 589–600. IEEE, 2010. doi:10.1109/ICDE.2010.5447916.
  • [6] Nofar Carmeli, Batya Kenig, and Benny Kimelfeld. Efficiently enumerating minimal triangulations. In Proceedings of the 36th ACM Symposium on Principles of Database Systems (PODS 2017), pages 273–287. ACM, 2017. doi:10.1145/3034786.3056109.
  • [7] Arthur Cayley. A theorem on trees. Quarterly Journal of Pure and Applied Mathematics, 23:376–378, 1889.
  • [8] Jeremy Chen, Yuqing Huang, Mushi Wang, Semih Salihoglu, and Ken Salem. Accurate summary-based cardinality estimation through the lens of cardinality estimation graphs. Proc. VLDB Endow., 15(8):1533–1545, 2022. doi:10.14778/3529337.3529339.
  • [9] Alessandro D’atri and Marina Moscarini. On hypergraph acyclicity and graph chordality. Information Processing Letters, 29(5):271–274, 1988. doi:10.1016/0020-0190(88)90121-4.
  • [10] Pablo De Caria and Marisa Gutierrez. On basic chordal graphs and some of its subclasses. Discrete Applied Mathematics, 210:261–276, 2016. doi:10.1016/j.dam.2015.05.002.
  • [11] David DeHaan and Frank Wm. Tompa. Optimal top-down join enumeration. In Proceedings of SIGMOD 2007, pages 785–796, 2007. doi:10.1145/1247480.1247567.
  • [12] David Eppstein. Representing all minimum spanning trees with applications to counting and generation. UC Irvine, 1995.
  • [13] Ronald Fagin. Degrees of acyclicity for hypergraphs and relational database schemes. J. ACM, 30(3):514–550, 1983. doi:10.1145/2402.322390.
  • [14] Leonidas Fegaras. A new heuristic for optimizing large queries. In Proceedings of DEXA 1998, volume 1460 of Lecture Notes in Computer Science, pages 726–735. Springer, 1998. doi:10.1007/BFB0054528.
  • [15] Pit Fender and Guido Moerkotte. Counter strike: Generic top-down join enumeration for hypergraphs. Proc. VLDB Endow., 6(14):1822–1833, 2013. doi:10.14778/2556549.2556565.
  • [16] Georg Gottlob, Matthias Lanzinger, Cem Okulmus, and Reinhard Pichler. Fast parallel hypertree decompositions in logarithmic recursion depth. ACM Trans. Database Syst., 49(1):1:1–1:43, 2024. doi:10.1145/3638758.
  • [17] Yuxing Han, Ziniu Wu, Peizhi Wu, Rong Zhu, Jingyi Yang, Liang Wei Tan, Kai Zeng, Gao Cong, Yanzhao Qin, Andreas Pfadler, Zhengping Qian, Jingren Zhou, Jiangneng Li, and Bin Cui. Cardinality estimation in dbms: A comprehensive benchmark evaluation. Proc. VLDB Endow., 15(4):752–765, 2021. doi:10.14778/3503585.3503586.
  • [18] Frank Harary. A characterization of block-graphs. Canadian Mathematical Bulletin, 6(1):1–6, 1963.
  • [19] Zongyan He and Jeffrey Xu Yu. A branch-&-bound algorithm for fractional hypertree decomposition. Proc. VLDB Endow., 17(13):4655–4667, 2024. URL: https://www.vldb.org/pvldb/vol17/p4655-he.pdf.
  • [20] Zeyuan Hu, Yisu Remy Wang, and Daniel P. Miranker. Treetracker join: Simple, optimal, fast. ACM Trans. Database Syst., October 2025. Just Accepted. doi:10.1145/3774325.
  • [21] Toshihide Ibaraki and Tiko Kameda. On the optimal nesting order for computing n-relational joins. ACM Trans. Database Syst., 9(3):482–502, 1984. doi:10.1145/1270.1498.
  • [22] Sanjiv Kapoor and H. Ramesh. Algorithms for enumerating all spanning trees of undirected and weighted graphs. SIAM Journal on Computing, 24(2):247–265, 1995. doi:10.1137/S009753979225030X.
  • [23] Ravi Krishnamurthy, Haran Boral, and Carlo Zaniolo. Optimization of nonrecursive queries. In Proceedings of the 12th International Conference on Very Large Data Bases (VLDB 1986), pages 128–137. Morgan Kaufmann, 1986. URL: http://www.vldb.org/conf/1986/P128.PDF.
  • [24] Viktor Leis, Andrey Gubichev, Atanas Mirchev, Peter Boncz, Alfons Kemper, and Thomas Neumann. How good are query optimizers, really? Proc. VLDB Endow., 9(3):204–215, 2015. doi:10.14778/2850583.2850594.
  • [25] Arne Leitert. Computing the union join and subset graph of acyclic hypergraphs in subquadratic time. In WADS 2021, volume 12808 of Lecture Notes in Computer Science, pages 571–584. Springer, 2021. doi:10.1007/978-3-030-83508-8_41.
  • [26] Feifei Li, Bin Wu, Ke Yi, and Zhuoyue Zhao. Wander join: Online aggregation via random walks. In Proceedings of the 2016 International Conference on Management of Data (SIGMOD 2016), pages 615–629. ACM, 2016. doi:10.1145/2882903.2915235.
  • [27] Zheng Luo, Wim Van den Broeck, Guy Van den Broeck, and Yisu Remy Wang. Algorithms for optimizing acyclic queries, 2026. doi:10.48550/arXiv.2509.14144.
  • [28] David Maier. The Theory of Relational Databases. Computer Science Press, 1983.
  • [29] Guido Moerkotte and Thomas Neumann. Analysis of two existing and one new dynamic programming algorithm for the generation of optimal bushy join trees without cross products. In Proceedings of VLDB 2006, pages 930–941, 2006. URL: http://dl.acm.org/citation.cfm?id=1164207.
  • [30] Guido Moerkotte and Thomas Neumann. Dynamic programming strikes back. In Proceedings of the ACM SIGMOD International Conference on Management of Data (SIGMOD 2008), pages 539–552. ACM, 2008. doi:10.1145/1376616.1376672.
  • [31] Thomas Neumann. Query simplification: Graceful degradation for join-order optimization. In Proceedings of SIGMOD 2009, pages 403–414, 2009. doi:10.1145/1559845.1559889.
  • [32] Øystein Ore. Theory of Graphs, volume 38 of American Mathematical Society Colloquium Publications. American Mathematical Society, 1962. doi:10.1090/coll/038.
  • [33] Patricia G. Selinger, Morton M. Astrahan, Donald D. Chamberlin, Raymond A. Lorie, and Thomas G. Price. Access path selection in a relational database management system. In Proceedings of SIGMOD 1979, pages 23–34, 1979. doi:10.1145/582095.582099.
  • [34] Akiyoshi Shioura, Akihisa Tamura, and Takeaki Uno. An optimal algorithm for scanning all spanning trees of undirected graphs. SIAM J. Comput., 26(3):678–692, 1997. doi:10.1137/S0097539794270881.
  • [35] Michael Steinbrunn, Guido Moerkotte, and Alfons Kemper. Heuristic and randomized optimization for the join ordering problem. VLDB Journal, 6(3):191–208, 1997. doi:10.1007/S007780050040.
  • [36] Vaishali Surianarayanan, Anikait Mundhra, Ajaykrishnan E. S, and Daniel Lokshtanov. Fast hypertree decompositions via linear programming: Fractional and generalized. Proc. ACM Manag. Data, 3(3):159:1–159:27, 2025. doi:10.1145/3725296.
  • [37] Arun N. Swami. Optimization of large join queries: Combining heuristic and combinatorial techniques. In Proceedings of SIGMOD 1989, pages 367–376, 1989. doi:10.1145/67544.66961.
  • [38] Robert E. Tarjan and Mihalis Yannakakis. Simple linear-time algorithms to test chordality of graphs, test acyclicity of hypergraphs, and selectively reduce acyclic hypergraphs. SIAM Journal on Computing, 13(3):566–579, 1984. doi:10.1137/0213035.
  • [39] Transaction Processing Performance Council. TPC Benchmark H (Decision Support). https://tpc.org/tpc_documents_current_versions/pdf/tpc-h_v3.0.1.pdf, 2023. Standard Specification, Revision 3.0.1.
  • [40] Qichen Wang, Bingnan Chen, Binyang Dai, Ke Yi, Feifei Li, and Liang Lin. Yannakakis+: Practical acyclic query evaluation with theoretical guarantees. Proc. ACM Manag. Data, 3(3):235:1–235:28, 2025. doi:10.1145/3725423.
  • [41] Yisu Remy Wang, Max Willsey, and Dan Suciu. Free join: Unifying worst-case optimal and traditional joins. Proc. ACM Manag. Data, 1(2), 2023. doi:10.1145/3589295.
  • [42] Mihalis Yannakakis. Algorithms for acyclic database schemes. In Proceedings of VLDB 1981, pages 82–94, 1981.
  • [43] C. T. Yu and M. Z. Ozsoyoglu. An algorithm for tree-query membership of a distributed query. In COMPSAC 1979, pages 306–312. IEEE, 1979. doi:10.1109/CMPSAC.1979.762509.
  • [44] Tao Yu, Rui Zhang, Kai Yang, Michihiro Yasunaga, Dongxu Wang, Zifan Li, James Ma, Irene Li, Qingning Yao, Shanelle Roman, Zilin Zhang, and Dragomir R. Radev. Spider: A large-scale human-labeled dataset for complex and cross-domain semantic parsing and text-to-sql task. In Proceedings of EMNLP 2018, pages 3911–3921. Association for Computational Linguistics, 2018. doi:10.18653/v1/d18-1425.
  • [45] Junyi Zhao, Kai Su, Yifei Yang, Xiangyao Yu, Paraschos Koutris, and Huanchen Zhang. Debunking the myth of join ordering: Toward robust sql analytics. Proc. ACM Manag. Data, 3(3), 2025. doi:10.1145/3725283.