Abstract 1 Introduction 2 Preliminaries 3 Decompositions Revisited 4 Pseudo-Trees 5 Combining the Two Worlds 6 Conclusion References

Query Decompositions and All That

Kyle Deeds ORCID University of Washington, Seattle, WA, USA Timo Camillo Merkl ORCID TU Wien, Austria Reinhard Pichler ORCID TU Wien, Austria Dan Suciu ORCID University of Washington, Seattle, WA, USA
Abstract

The close relationship between Conjunctive Queries (CQs) and Constraint Satisfaction Problems (CSPs) has long been known. Nevertheless, apart from decomposition methods, research on efficient query evaluation or constraint solving algorithms has developed rather independently. In this article, we illustrate how search algorithms originating from the CSP community can be fruitfully applied to query evaluation – either by further developing the original search algorithms or by combining them with query decomposition methods. It turns out that the resulting approaches may indeed lead to lower time and/or space complexity than previous query evaluation methods.

Keywords and phrases:
Query evaluation, Query decompositions, Complexity
Category:
Invited Talk
Copyright and License:
[Uncaptioned image] © Kyle Deeds, Timo Camillo Merkl, Reinhard Pichler, and Dan Suciu; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Database theory
; Information systems Query languages
Funding:
The work of Merkl and Pichler was supported by the Vienna Science and Technology Fund (WWTF) [10.47379/ICT2201, 10.47379/VRG18013, 10.47379/NXT22018]. Deeds and Suciu were partially supported by NSF IIS 2314527, NSF SHF 2312195, and NSF IIS 2507117.
Editors:
Balder ten Cate and Maurice Funk

1 Introduction

Conjunctive Queries (CQs, for short) are arguably the most fundamental class of (relational) queries. Consequently, the optimization of CQs has been a major topic in DB theory and systems research. Finding an optimal query evaluation plan is a highly non-trivial (in fact, intractable) problem. A particular challenge consists in avoiding the explosion of intermediate results. For acyclic CQs (ACQs, for short), Yannakakis’ algorithm [36] guarantees that intermediate results never exceed the combined size of input and output. In recent time, implementations of Yannakakis’ algorithm have found their way into mature research prototypes and industrial-strength database management systems [7, 35, 6, 26].

In general, we cannot expect all CQs to be acyclic. However, extensive analyses [8, 27, 13] of queries in benchmarks and query logs have shown that the majority of those queries are “almost acyclic”. Various types of query decomposition methods (with associated width-measures) have been proposed to transform such CQs into ACQs. Among the most thoroughly studied decomposition methods are tree decompositions (TDs) [31], (generalized) hypertree decompositions (GHDs and HDs, respectively) [17, 2], and fractional hypertree decompositions (FHDs) [20]. The associated width measures, that allow us to formalize the notion of “almost acyclic” CQs are tree-width (tw), (generalized) hypertree-width (ghw and hw, respectively), and fractional hypertree-width (fhw). Note that decomposition methods for query evaluation have been successfully implemented in several research prototypes [1, 32, 25].

The main “freedom” of query evaluation algorithms based on one of these decompositions is how to compute and materialize the subquery corresponding to each bag of the decomposition. Using some worst-case optional join (WCOJ) method is often considered as optimal. A basic and very intuitive form of WCOJ algorithm is the so-called Generic Join [29]. Assume the upper bound N on the size of the database. Then the time and space complexity of using an (optimal) FHD is essentially O(Nfhw) (data complexity). While this bound on the time complexity may be satisfactory, such a space complexity may actually be not acceptable.

Space is a critical bottleneck in query evaluation across diverse hardware settings. Modern in-memory databases suffer significant performance degradation when forced to spill to disk [33]. Similarly, tensor algebra programs, often modeled as Sum-Product Queries (SPQs, for short), are frequently executed on GPUs where high-bandwidth memory is scarce; the cost of data movement between GPU and CPU can easily dwarf computation time [30, 19]. Furthermore, in resource-constrained environments like embedded devices, memory limits are strict and must be respected [21, 22]. In all these contexts, the existing space-complexity bounds of current query evaluation techniques are insufficiently tight for practical optimization.

Now a natural question arises: can we do better? That is, can we improve the time and space requirements of query evaluation or, at least, improve one without deteriorating the other. Here, we are particularly interested in the question whether we can improve the space complexity of previous query evaluation approaches without (significantly) compromising the time complexity.

CQs have long been known to be closely related to Constraint Satisfaction Problems (CSPs) [24]. In fact, on the logical level, both correspond to first-order formulas restricted to the connectives , and excluding ,,¬. The above mentioned decomposition methods have actually been equally studied and applied in both areas. However, other than that, both areas have developed their own techniques. Here, we follow mostly Rina Dechter’s book [11], where “constraint networks” [10] (corresponding to Boolean CQs) as well as “probabilistic networks” and “cost networks” (which can be captured by scalar SPQs) have been studied. In [11], decomposition-based methods are referred to as “inference-based”. They are contrasted with the other important paradigm in the CSP-community, namely “search-based” methods.

In their basic form (so-called “OR-search”), search algorithms work by branching into possible instantiations of one variable after the other. This search is realized by nested loops which, for each variable, iterate through the possible values. By exploring one instantiation of each variable at a time, the space consumption is proportional to the number of variables and, therefore, constant when considering data complexity. A more sophisticated approach is an “AND/OR-search”, which exploits the fact that, after instantiating some variable(s), possible instantiations for other variables may be investigated independently. While OR-search is guided by an order on the variables (i.e., in which order to inspect possible instantiations), AND/OR search is guided by a tree structure, reflecting the independence of variables conditioned on their common ancestors. Here, we concentrate on pseudo-trees, which were introduced in [15] and studied in detail and further developed in [11]. As was observed in [12], Generic Join, which realizes the “attribute”- (= “variable-”) at-a-time” paradigm, corresponds to the less sophisticated OR-search.

The following example will help to illustrate some of the characteristics of the classes of query plans mentioned so far, namely tree decompositions, Generic Join, and pseudo-trees.

Figure 1: Query with 3 different plans (Example 1).
Example 1.

Consider the query

Q()E1(A,B)E2(B,C)E3(C,A)E4(D,E)E5(E,C)E6(C,D)

over some database D of size N. In Figure 1, we graphically display this query and show three different query plans:

  • The first one evaluates Q by using a tree decomposition with bags ABC and CDE in a straightforward way. That is, we first evaluate and materialize the subqueries restricted to the bags (in time and space O(N3/2), where the exponent corresponds to the fractional edge cover number of the triangle query, and then intersect the two results on C.

  • The next plan applies the Generic Join algorithm. Here, we have to fix a variable order – say A,B,C,D,E – and then proceed in nested loops. Since we inspect for each variable only one value at at time, the space consumption is constant (data complexity). The time complexity is O(N5/2), where the exponent corresponds to the fractional edge cover number ρ(Q) of the query Q.

  • The last plan uses a pseudo-tree with root node C and then branches into A,B and D,E, respectively. Here we make use of the fact that, for every value of C, we may evaluate the subqueries restricted to A,B,C and to C,D,E independently. We thus achieve O(N3/2) time complexity, while the space complexity is still constant.

Our goal is to study both decompositions and search-based methods as well as the relationship between them. To this end, we first recall properties of these methods individually and then study their combination. In particular, we look at what is gained in terms of time and/or space complexity, when using pseudo-tree-based algorithms for evaluating the subquery at each bag of a (tree) decomposition. We thus analyze various classes of query plans in terms of data complexity. As “yardstick”, we consider their space and time exponents. More specifically, we will say that a query plan Π in a given class of query plans has space-time exponent e(Π)=(s(Π),t(Π)), if the “canonical” evaluation algorithm executing the query plan Π has space complexity O(Ns(Π)) and time complexity O(Nt(Π)), where N is a bound on the size of the database. For instance, as fundamentally different approaches we have Generic Join plans Π with e(Π)=(0,ρ(Q)) and plans Π using a (tree) decomposition and WCOJ to evaluate and materialize the subqueries at each bag with e(Π)=(fhw(Q),fhw(Q)). That is, the space complexity of Generic Join plans is clearly optimal, while plans based on a decomposition plus WCOJ are, in general, superior in terms of time consumption.

The focus of this article will be on illustrating the key ideas of various classes of query plans by means of examples. Formal proofs of all results mentioned here can be found in [12]. To keep things simple and in the interest of clarity, we will concentrate on CQs and, in particular, Boolean CQs. We note that, in [12], the more general case of SPQs over some semi-ring 𝕂 and with output variables is studied.

The remainder of this article is structured as follows: After introducing some basic definitions and results in Section 2, we revisit query plans based on decompositions in Section 3. In Section 4, we will study several variants of pseudo-trees. The combination of decompositions and pseudo-trees will then be discussed in Section 5. We conclude with a summary and an outlook on future work in Section 6.

2 Preliminaries

In this paper, we focus on Conjunctive Queries (CQs), which correspond to select-project-join queries in the Relational Algebra. W.l.o.g., we restrict ourselves to CQs of the form Q=π𝑿(R1Rm). Here we assume that equi-joins are replaced by natural joins via appropriate renaming of attributes. Moreover, we assume that selections applying to a single relation have been pushed immediately in front of this relation and the Ri’s are the result of these selections. Alternatively, we denote CQs in Datalog-style notation and write them as

Q(𝑿) i=1mRi(𝑿i). (1)

Q is a Boolean CQ, if 𝑿 is the empty set. Recall that, from a logical point of view, CQs and Constraint Satisfaction Problems (CSPs) are, the same. Hence, our discussion equally applies to CSPs.

By slight abuse of notation, we write Ri both, to denote a relation (in a Relational Algebra expression) and a relation symbol (in Datalog notation). We denote (sets of) variables (also called attributes) by capital letters A,B,C, (𝑿,𝒀,𝒁,) and (tuples of) domain values by lowercase letters a,b,c, (𝒙,𝒚,𝒛,). We will also refer to variables as attributes when this is more appropriate. We write 𝑣𝑎𝑟(Q) and 𝑎𝑡𝑜𝑚𝑠(Q) to denote the set of variables in Q and the set of atoms in Q, respectively, i.e., 𝑣𝑎𝑟(Q)=i=1m𝑿i and 𝑎𝑡𝑜𝑚𝑠(Q)={Ri(𝑿i)1im}. If 𝑿,𝒀 are two sets of variables and 𝒙𝐝𝐨𝐦𝑿, then we denote by 𝒙[𝒀] the projection of 𝒙 on the variables 𝑿𝒀. Throughout this paper we fix an infinite domain 𝐝𝐨𝐦 and we write 𝐚𝐝𝐨𝐦i to denote the (finite) set of domain values actually occurring in attribute Ai in the given database D, i.e., the active domain of Ai.

Unless mentioned otherwise, we consider set semantics. Then the semantics of Q in Eq. (1) on a database D is the relation QD𝐝𝐨𝐦𝑿 defined as

QD:={𝒙𝐝𝐨𝐦𝑿 there exists 𝒚𝐝𝐨𝐦𝑣𝑎𝑟(Q)𝑿, s.t. for every i,(𝒙,𝒚)[𝑿i]RiD}.

Sometimes, we will switch to bag semantics. Then the semantics of Q in Eq. (1) on a database D is a mapping QD:𝐝𝐨𝐦𝑿, which assigns to every 𝒙𝐝𝐨𝐦𝑿 the cardinality |{𝒚𝐝𝐨𝐦𝑣𝑎𝑟(Q)𝑿 for every i,(𝒙,𝒚)[𝑿i]RiD}|. We will mostly consider Boolean queries and, in this case, under bag semantics we have to count the number of tuples 𝒙𝐝𝐨𝐦𝑣𝑎𝑟(Q) that satisfy the right hand side of Eq. (1). We may omit the superscript D when it is clear from the context, and simply write Ri, Q.

Let 𝒀𝑣𝑎𝑟(Q) be a set of variables. A fractional edge cover of 𝒀 (with respect to Q) is a weight function w:𝑎𝑡𝑜𝑚𝑠(Q)[0,1], such that, for every variable A𝒀, i:A𝑿iw(Ri(𝑿i))1. The fractional edge cover number of 𝐘, denoted ρ(𝒀), is the minimum value of iw(Ri(𝑿i)) attainable by fractional edge covers w of 𝒀. Due to [4], we know that |D|ρ(𝒀) is an upper bound on the number of tuples 𝒚𝐝𝐨𝐦𝒀 that satisfy the query Q restricted to the variables 𝒀111Formally, we mean that for every Ri there has to exist an 𝒙iRi such that 𝒙i[𝒀]=𝒚[𝑿i]..

A CQ is called acyclic (an ACQ, for short), if it has a join tree, i.e., a labeled tree T,λ with node-labeling function λ such that (1) for every relation Ri there exists exactly one node u of T with λ(u)=Ri and (2) λ satisfies the so-called connectedness condition, i.e., if some attribute A occurs in both relations λ(u) and λ(v) for two nodes u,v of T, then A occurs in the relation λ(w) for every node w on the path between u and v.

Yannakakis [36] has shown that ACQs can be efficiently evaluated (that is, essentially, linear w.r.t. the input+output data and linear w.r.t. the size of the query) via 3 traversals of the join tree: (1) a bottom-up traversal of semi-joins, (2) a top-down traversal of semi-joins, and (3) a bottom-up traversal of joins. Formally, let u be a node in T with child nodes u1,,uk of u and let relations R, Ri1,,Rik be associated with the nodes u, u1,,uk at some stage of the computation. Then we set

  1. (1)

    R=(((RRi1)Ri2))Rik,

  2. (2)

    Rij=RijR for every j{1,,k}, and

  3. (3)

    R=(((RRi1)Ri2))Rik

in the 3 traversals (1), (2), and (3). The final result of the query can be read off from the resulting relation associated with the root r of T. Importantly, in case of a Boolean CQ, only the first bottom-up traversal of semi-joins is needed: a Boolean CQ evaluates to true, iff this bottom-up traversal yields a non-empty relation at the root r of T.

In this paper, we examine the data complexity of evaluating CQs with various types of query plans, i.e., we measure the space and time complexity as exponentials w.r.t. an upper bound N on the number of tuples in the given database D. We consider a query plan Π for a query Q as a structure that is associated with a specific algorithm for evaluating Q, e.g., in case of an ACQ Q, we may consider a join tree as a query plan, which is associated with Yannakakis’ algorithm. We denote a class of plans by 𝒞, e.g. all tree decompositions, and the plans of 𝒞 for a query Q as 𝒞(Q). Each plan Π is associated with a space exponent s(Π) and a time exponent t(Π). The latter bounds the associated algorithm’s runtime by O~(|D|t(Π)). The former bounds the space used by the algorithm by O(|D|s(Π)), excluding the space required to store the input relations. We refer to these jointly as space-time exponents e(Π)=(s(Π),t(Π)).

Definition 2 (Plan Domination).

Let Π1,Π2 be two plans for the same query Q. We say Π1 improves over Π2, or that Π1 dominates Π2, denoted Π1Π2, if t(Π1)t(Π2) and s(Π1)s(Π2). We say that Π1 strictly dominates Π2, denoted Π1Π2, if Π1Π2 but not vice versa. We may write Π1Π2, if both Π1,Π2 and Π1Π2 hold.

A class of plans 𝒞1 improves over (dominates) another class 𝒞2, denoted 𝒞1𝒞2, if for every query Q, it holds that Π2𝒞2(Q), Π1𝒞1(Q) such that Π1Π2. We say that 𝒞1 strictly dominates 𝒞2, denoted 𝒞1𝒞2, if 𝒞1𝒞2 holds but not vice versa. We may write 𝒞1𝒞2 if both 𝒞1𝒞2 and 𝒞1𝒞2 hold.

3 Decompositions Revisited

Several forms of decompositions have been proposed to make use of structural properties of the query in the quest for efficient query evaluation algorithms. The most fundamental form are tree decompositions (TDs, for short). They were originally introduced for graphs [31]. In case of queries (notably CQs), the underlying structure is best captured by hypergraphs. In principle, we could therefore associate with every hypergraph a graph and define TDs of a hypergraph as TDs of the corresponding graph. We prefer to define TDs (and, based on TDs, the other forms of decompositions studied here) directly for CQs without taking the detour via the underlying hypergraph and an associated graph. Our notion of TDs corresponds to the definition of the TD via the “primal graph” of the hypergraph, i.e., the graph whose vertices are identical with the vertices of the hypergraph and two vertices are adjacent in the graph if they jointly occur in some hyperedge. This is arguably the most common way of defining the TD of a hypergraph and, ultimately, of a CQ, but not the only possible way, e.g.: in [9], TDs defined via the so-called “incidence graph” were considered.

Definition 3.

For a given CQ Q, a tree decomposition (TD, for short) of Q is a tuple (T,χ) where T=(V,E) is a directed tree and χ:V2𝑣𝑎𝑟(Q) is a node-labeling function that assigns a set of variables to every node, satisfying the following conditions:

  1. 1.

    for every Ri(𝑿i)𝑎𝑡𝑜𝑚𝑠(Q), there exists a node vV with 𝑿iχ(v);

  2. 2.

    for every A𝑣𝑎𝑟(Q), the nodes v with Aχ(v) form a connected subset of V.

The sets χ(v) are called bags. The width of a TD is the maximum size of its bags minus 1, i.e., width(T,χ)=maxv(|χ(v)|)1. The tree-width tw(Q) of a CQ Q is defined as the minimum width attainable by a TD of Q, i.e., tw(Q)=min(T,χ)(width(T,χ)). Note that, usually, TDs are considered as undirected trees. However, since we want to use TDs as query plans, it is more convenient to consider TDs as directed trees, since we will ultimately evaluate a (Boolean) CQ by a bottom-up traversal of the tree.

A straightforward way of evaluating a CQ Q by making use of a TD is to compute and materialize, for every node v, the query restricted to the variables in the bag χ(v) to turn the CQ into an ACQ and then to apply Yannakakis’ algorithm. Hence, the principal source of complexity when using a TD for query evaluation are the subqueries Qv corresponding to each bag. Clearly, there is a choice as to what plan we use to compute the subqueries Qv. The most naive evaluation consists in associating with each bag with variables Xi1,,Xiα the relation obtained by computing the query restricted to those atoms which are covered by χ(v) and extending the result to the variables not contained in the subquery by allowing these variables to take any value from their active domain. That is, for every node vV, we compute the subquery Qv=(iIvRi)×(×jJv𝐚𝐝𝐨𝐦j), where the index sets Iv and Jv are defined as Iv={i𝑿iχ(v)} and Jv={AjAjχ(v) and iIv with Xj𝑿i}, respectively. We can then transform Q into an equivalent ACQ vVQv and evaluate this ACQ by applying Yannakakis’ algorithm to it. The space and time exponents of this approach are essentially (tw(Q)+1,tw(Q)+1) (cf. [10]).

A better evaluation strategy was proposed in [17] by extending TDs to hypertree decompositions (HDs, for short):

Definition 4.

For a given CQ Q, a hypertree decomposition (HD, for short) of Q is a tuple (T,λ,χ) where (T,χ) is a tree decomposition and λ:V2𝑎𝑡𝑜𝑚𝑠(Q) is another node-labeling function that assigns a set of atoms to every node, satisfying (in addition to the properties of TDs according to Definition 3) the following conditions:

  1. 3.

    for every uV, the atoms in λ(u) are an integral edge cover of χ(u), i.e., χ(u)𝑣𝑎𝑟(λ(u));

  2. 4.

    for every uV, the so-called “special condition” holds, i.e., let Tu denote the subtree rooted at u, then (vTuχ(v))𝑣𝑎𝑟(λ(u))χ(u).

The width of an HD is the maximum size of its λ-labels, i.e., width(T,λ,χ)=maxv(|λ|). The hypertree-width hw(Q) of a CQ Q is defined as the minimum width attainable by an HD of Q, i.e., hw(Q)=min(T,λ,χ)(width(T,λ,χ)). Note that the fourth condition in Definition 4 was introduced in [17] only to make the problem of deciding, if hw(Q)k holds, tractable for fixed k1. When using an HD for query evaluation, this condition is irrelevant. If we drop the fourth condition, we get Generalized Hypertree Decompositions (GHDs, for short) with generalized hypertree-width, denoted ghw(Q) as the associated width measure [2]. Clearly, GHDs generalize HDs and ghw(Q)hw(Q) holds for every CQ Q. The downside of GHDs is that even deciding if ghw(Q)2 for given query Q holds, is NP-complete [18, 16].

Bounded hw and bounded ghw generalize acyclicity in that ACQs are precisely the CQs with hw=ghw=1. In order to turn a CQ with given HD or GHD into an ACQ, we just need to join the relations in the λ-label and project the result to the χ-label for every node vV. That is, for every vV, we compute the subquery Qv=πχ(v)(Ri(𝑿i)λ(v)Ri). The resulting ACQ vVQv can then be evaluated by applying Yannakakis’ algorithm. We thus get the space-time exponents (hw(Q),hw(Q)) and (ghw(Q),ghw(Q)), respectively [17].

A further refinement of this technique was proposed in [20] by introducing fractional hypertree decompositions (FHDs, for short):

Definition 5.

For a given CQ Q, a fractional hypertree decomposition (FHD, for short) of Q is a tuple (T,γ,χ), where (T,χ) is a tree decomposition and γ:V[0,1]𝑎𝑡𝑜𝑚𝑠(Q), satisfying (in addition to the properties of TDs according to Definition 3) the following condition:

  1. 3.

    for every uV, γ(u) is a fractional edge cover of χ(u), i.e., γ(u):𝑎𝑡𝑜𝑚𝑠(Q)[0,1], such that, for every Aχ(v), i:ARi(𝑿i)γ(v)(Ri(𝑿i))1.

The width of an FHD is defined as the maximum weight of its γ-labels, i.e., width(T,γ,χ)=maxv(iγ(v)(Ri(𝑿i))). The fractional hypertree-width fhw(Q) of a CQ Q is defined as the minimum width attainable by an FHD of Q, i.e., fhw(Q)=min(T,γ,χ)(width(T,γ,χ)). In order to turn a CQ with given FHD into an ACQ, we need to evaluate the query Q restricted to the variables in χ(v) for every vV, i.e., Qv(χ(v))=i=1mRi(𝑿iχ(v)). By using a WCOJ method such as Generic Join [29], the maximal output size and the time for evaluating such a query Qv over a database D is O(|D|ρ(χ(v))). The resulting ACQ vVQv can then be evaluated by Yannakakis’ algorithm, leading to the space-time exponents (fhw(Q),fhw(Q)) [20].

For every CQ Q, we clearly have fhw(Q)ghw(Q)hw(Q)tw(Q)+1. Hence, treating a TD as an FHD and evaluating the subqueries at each bag by some WCOJ techniques in order to turn Q into an ACQ, is optimal among the decomposition methods discussed in this section. As mentioned, e.g., in [11], one can even do better space-wise. More specifically, it suffices to materialize only the subqueries restricted to the variables in the intersection between the bags at a node and its parent. To each vertex vV of a TD (T,χ), we thus associate a query as follows. Let 𝒀v:=χ(v) and 𝒁v:=χ(v)χ(𝑝𝑎𝑟𝑒𝑛𝑡(v)) or, if v is the root node, then 𝒁v:=. Then we compute, in a bottom-up traversal of the TD, the queries

Qv(𝒁v)i=1mRi(𝑿i𝒀v)w𝑐ℎ𝑖𝑙𝑑(v)Qw(𝒁w).

Using a WCOJ method such as Generic Join for evaluating each of these subqueries, we end up with the space-time exponents s(T,χ)=max(u,v)E(T)ρ(χ(u)χ(v)) and t(T,χ)=maxvV(T)ρ(χ(v)). The latter is equal to fhw(T,χ), if (T,χ) is the TD underlying an FHD of minimum width.

4 Pseudo-Trees

In this section, we discuss pseudo-trees [15, 11] together with several extensions. It will turn out that WCOJ algorithms such as Generic Join [29] can actually be seen as a special case of pseudo-tree-based algorithms. We therefore revisit Generic Join (GJ)) query plans first.

4.1 Generic Join

The Generic Join (GJ) algorithm [29] fixes an arbitrary order on the variables A1,,Ak of a given CQ Q and computes iteratively partial assignments 𝒚j=(a1,,aj) on 𝒀j=(A1,Aj), for all 0jk. It starts with the empty assignment 𝒚0:=() and, in k nested loops, it extends it to one variable after the other, as follows. Assuming a partial assignment 𝒚j1=(a1,,aj1), the j’th nested loop iterates through all values aj in i:Aj𝑿iRi[Aj|𝒚j1] to extend 𝒚j1 to a partial assignment 𝒚j=(a1,,aj1,aj). Here, we write Ri[Aj|𝒚j1] to denote the set of values of attribute Aj in relation Ri restricted to those tuples that coincide with 𝒚j1 on all attributes in 𝑿i{A1,,Aj1}. GJ computes the intersection above in time proportional to the smallest set, for example, by iterating over the smallest set and probing (using hash tables) in all the other sets.

Definition 6.

A Generic Join Plan of a query Q is a total order on its variables, Π=(A1,,Ak). We denote by 𝒢𝒥 (resp. 𝒢𝒥(Q)) the set of all Generic Join plans (of Q). In case of a Boolean query Q, the space-time exponents of any Π𝒢𝒥(Q) are e(Π)=(0,ρ(𝑣𝑎𝑟(Q))).

Theorem 7 ([29]).

Let Q be a Boolean query. If Π𝒢𝒥(Q), then we can compute Q based on Π in space and time given by e(Π). Concretely, the space used is O(|D|0) (i.e., constant), and the time spent is O(|D|ρ(𝑣𝑎𝑟(Q))).

4.2 Basic Form of Pseudo-Trees

Pseudo-tree-based algorithms improve upon 𝒢𝒥-algorithms by making use of the fact that the instantiation of some variables may split the query into disconnected parts that can be evaluated separately. This means that some of the inner loops of the 𝒢𝒥 algorithm can be executed in parallel rather than in a nested fashion. This idea is illustrated by the following simple example:

Example 8.

Consider the 3-path query Q()R1(A,B)R2(B,C). The bag semantics of Q() is obtained as a,b,c𝐝𝐨𝐦R1(a,b)R2(b,c). By slight abuse of notation, we are writing Ri(x,y) for the indicator expression 1Ri(x,y), which takes the value 1 if Ri contains the tuple (x,y) and which is 0 otherwise. GJ proceeds in 3 nested loops, e.g., for the variable ordering (A,B,C), GJ computes the expression abcR1(a,b)R2(b,c), with runtime O(|R1||R2|), i.e., the time exponent is ρ(Q)=2. A pseudo-tree based algorithm, in contrast, iterates over B first, then performs two independent loops that iterate over A and C respectively; this corresponds to the expression b(aR1(a,b))(cR2(b,c)), and the runtime is O(|R1|+|R2|), i.e., the time exponent is 1. Structurally speaking, the loops of GJ can be described as a path while the loops of the pseudo-tree based algorithm are tree-structured where B is the root and A,C are its children, i.e., .

To formally define and analyze pseudo-tree algorithms, we introduce the following notation: For a directed tree T=(𝑽,E) and A𝑽, we denote by 𝑎𝑛𝑐(A) the set of ancestors of A excluding A, and write anc¯(A)=𝑎𝑛𝑐(A){A}. Similarly, we write 𝑑𝑒𝑠𝑐(A) and desc¯(A) for the set of descendants of A, without and with A respectively.

Definition 9 ([15, 11]).

A pseudo-tree (PT) of a query Q is a directed tree P=(𝐕,E), such that every atom Ri(𝐗i) is contained in a branch: formally, A𝐕 such that 𝐗ianc¯(A).

Definition 10.

The class of query plans 𝒫𝒯(Q) of a query Q consists of pseudo-trees P of Q. In case of a Boolean query Q, the space-time exponents of any P𝒫𝒯(Q) are e(P):=(0,maxA𝑣𝑎𝑟(Q)ρ(anc¯(A)).

Pseudo-tree plans strictly dominate GJ plans, i.e. 𝒫𝒯𝒢𝒥, because any variable order of a GJ can be converted into a linear PT A1A2Ak, and the two plans have the same space-time exponents, thus 𝒫𝒯𝒢𝒥. On the other hand, the 3-path query in Example 8 shows that 𝒢𝒥𝒫𝒯. Indeed, while 𝒫𝒯-plans still require constant space, their time exponent is no longer given by the fractional edge cover number of all variables but by the maximum fractional edge cover number over all branches in the given pseudo-tree.

Theorem 11.

Let Q be a Boolean query. If P𝒫𝒯(Q), then we can compute Q based on P in space and time given by e(P). Concretely, the space used is O(|D|0) (i.e., constant), and the time spent is O(|D|t(P)) with t(P)=maxA𝑣𝑎𝑟(Q)ρ(anc¯(A)).

Theorem 11 is based on an algorithm that simply uses a loop structure that mimics the pseudo-tree P. That is, the top-most loop iterates through the possible values a1 for the variable at the root R=root(P). Then, there is an independent nested loop for each child of R and so on …. Reconsidering the query used in Example 1, the pseudo-tree-based loops arising from the pseudo-tree are the ones depicted in Figure 1. Importantly, the loops proceed as GJ does. That is, at the loop for some A𝑣𝑎𝑟(Q), the loops above it fix a partial assignment 𝒚𝐝𝐨𝐦𝑎𝑛𝑐(A) which is then extended by a value ai:A𝑿iRi[A|𝒚] to the partial assignment (𝒚,a). Iterating over the smallest of these sets and probing in the other, the time at A is determined by ρ(anc¯(A)) (over all 𝒚).

4.3 Pseudo-Trees with Caches

We now consider the extension of pseudo-trees by caches to store intermediate results and avoid their recomputation. A cache is a data structure that maps from a set of keys to a set of values. As is illustrated in the next example, caches make a time-space trade-off possible.

Example 12.

To motivate caching, consider the 4-path query Q()R(A,B)S(B,C)T(C,D) under bag semantic, and consider the linear PT , where A is the root. The runtime of this plan is given by the AGM bound [3], O(N2). Intuitively, this query plan corresponds to the summation a(bR(a,b)(cS(b,c)(dT(c,d))))222As in Example 8, we are writing Ri(x,y) for the indicator expression 1Ri(x,y), which takes the value 1 if Ri contains the tuple (x,y) and which is 0 otherwise.. We note that the subexpression MC(b):=cS(b,c)dT(c,d) is independent of a, and, by caching the values MC(b), we can avoid recomputing this expression for different values a. Similarly, we can cache MD(c):=dT(c,d). By adding caches, we can trade space for time. In our example, filling the cache MD() for all possible values of c requires at most linear time. Likewise, filling the cache MC() for all possible values of b can be done in linear time, i.e.: we have to iterate through all tuples S(b,c) but, due to caching, we only need to iterate once through all tuples T(c,d). Hence, the two caches MC and MD decrease the runtime of the PT given above from O(N2) to O(N), while the space increases from O(1) to O(N).

Suppose that we want to store the results for possible extensions of partial solutions to the attribute A in a cache MA. The key of MA is called the context of A, defined as follows.

Definition 13 ([11]).

The context of a variable A𝐕 is defined as

𝑐𝑜𝑛(A)={B𝑎𝑛𝑐(A)Cdesc¯(A), s.t. B,C𝑿i for some atom Ri(𝑿i) of Q},

and the closed context of A is con¯(A)=𝑐𝑜𝑛(A){A}.

The main property of 𝑐𝑜𝑛(A) is that the subquery corresponding to the subtree (of the pseudo-tree) rooted at A does not depend on the instantiation of all ancestors of A but only on the instantiation of the variables in 𝑐𝑜𝑛(A). Therefore, we can cache these values in a cache MA with key 𝑐𝑜𝑛(A), whose values are subsets of 𝐝𝐨𝐦A (equivalently, mappings 𝐝𝐨𝐦A𝔹) or mappings 𝐝𝐨𝐦A for set and bag semantics, respectively. Hence, the type of this cache is MA:𝐝𝐨𝐦𝑐𝑜𝑛(A)(𝐝𝐨𝐦A𝔹) or MA:𝐝𝐨𝐦𝑐𝑜𝑛(A)(𝐝𝐨𝐦A), respectively, which is equivalent to MA:𝐝𝐨𝐦con¯(A)𝔹 or MA:𝐝𝐨𝐦con¯(A), respectively. Therefore, the space usage of the cache MA is given by ρ(con¯(A)) as each cached tuple satisfies the query Q restricted to variables con¯(A).

To determine the time spent by the algorithm at node A, suppose that some Banc¯(A) uses a cache, and let B be closest to A with this property. Moreover, suppose that we want to extend a partial solution to the attribute A for some instantiation 𝒙 of 𝑎𝑛𝑐(A) and later for another instantiation 𝒚 of 𝑎𝑛𝑐(A). Further, let 𝒙[𝑐𝑜𝑛(B)]=𝒚[𝑐𝑜𝑛(B)]. Then, 𝒙[𝑎𝑛𝑐(B)] and 𝒚[𝑎𝑛𝑐(B)] must have both resulted in a cache miss at B. However, this only happens the first time the partial instantiation 𝒙[𝑎𝑛𝑐(B)] is considered. Thus, 𝒙[𝑎𝑛𝑐(B)] and 𝒚[𝑎𝑛𝑐(B)] must be the same partial instantiation and we can essentially ignore 𝑎𝑛𝑐(B)𝑐𝑜𝑛(B) in the computation of the time spent at A. Let [A,B]anc¯(A) be the variables along the path connecting A to B. Put differently, at A the values of the variables 𝑐𝑜𝑛(B)[A,B] are unique and they are the only variables of anc¯(A) relevant to the time consumption by the loop at A.

Example 14.

Let us compute the space-time usage of plans for the 5-path Q()R1(A,B)R4(D,E) for three different cache setups. We always use the linear PT . Without a cache, we simply compute a,bR1(a,b)ceR4(d,e) with O(1) space and O(N3) time usage. The worst time usage is at E and given by ρ(anc¯(E))=ρ(AE)=3. With a cache at C, we compute a,bR1(a,b)MC(b) and MC(b)=cR2(b,c)dR3(c,d)eR4(d,e) with O(N) space and O(N2) time usage. The worst time usage is again given at E but computed as ρ(𝑐𝑜𝑛(C)[E,B])=ρ(BE)=2. Lastly, when we add caches at D and E as well, we compute a,bR1(a,b)MC(b), MC(b)=cR2(b,c)MD(c), MD(c)=dR3(c,d)ME(d), and ME(d)=eR4(d,e), resulting in O(N) space and O(N) time usage.

We are now ready to define a pseudo-tree with caching and its space-time exponents:

Definition 15.

A pseudo-tree with caching (PTC) of a query Q is a pair (P,𝐂), where P=(𝐕,E) is a PT of Q, and 𝐂𝐕 is a subset of the variables for which we add a cache. We require root(P)𝐂.

Definition 16.

The class of query plans 𝒫𝒯𝒞(Q) of a query Q consists of pseudo-trees with caching (P,𝐂) of Q. If Q is a Boolean query, then the space and time exponents of a 𝒫𝒯𝒞(Q) plan (P,𝐂) are defined as:

s(P,𝑪):=maxA𝑪ρ(𝑐𝑜𝑛(A)),t(P,𝑪):=maxAV(P)ρ(𝑐𝑜𝑛(BA)[A,BA]),

where BA:=min(𝐂anc¯(A)), i.e., the node in anc¯(A) closest to A with a cache.

Pseudo-trees with caches strictly dominate pseudo-trees, i.e. 𝒫𝒯𝒞𝒫𝒯, because a 𝒫𝒯𝒞(Q)-plan with no caches (i.e., 𝑪={root(P)}), is simply a 𝒫𝒯(Q)-plan. On the other hand, we have 𝒫𝒯𝒫𝒯𝒞, since the space-time exponents of the 𝒫𝒯𝒞-plan for the 4-path query shown in Example 12 are not attainable with a 𝒫𝒯-plan.

Theorem 17.

Let Q be a Boolean query. If (P,𝐂)𝒫𝒯𝒞(Q), then we can compute Q based on (P,𝐂) in space O(|D|s(P,𝐂)) and time O(|D|t(P,𝐂)).

4.4 Pseudo-Trees with Caching and Resets

We have seen how the addition of caches reduces the time exponent while increasing the space exponent of a pseudo-tree. Now we describe pseudo-trees with caching and resets, 𝒫𝒯𝒞, which allow for a finer trade-off between space and time. The basic principle was introduced in [11], while a complexity analysis and further improvements were presented in [12].

Figure 2: Query .
Figure 3: Query Q.
Figure 4: PTCR for Q.
Example 18.

To motivate resetting caches, consider the query () in Figure 2 with bag semantics and the PT . Adding caches to E,F leads to space-time exponents of (1.5,2). For example, the cache ME for variable E has key 𝑐𝑜𝑛(E)=ABD, and its space usage is given by ρ(ABD)=1.5. When extending a partial solution abcd to attribute E, the result is stored in ME(abd). Later, if c has changed while abd are the same, the result can be retrieved from the cache. Note that, once the value of a or b changes, we can safely discard (or reset) all entries ME(ab), because the values abc are processed in lexicographic order. We can, therefore, reduce the space of the cache by only keeping cached entries whose keys agree on AB – essentially only storing the results for different values of D. This decreases the space usage of ME to ρ(D)=1, and similarly for the cache MF. With this “reset” improvement, can be computed with space-time exponents (1,2).

In Example 18, resetting the cache did not increase the time complexity. However, this is not true in general. For example, if we drop the edge AE from the query (), then the context of attribute E becomes 𝑐𝑜𝑛(E)=BD. If we now drop B from the cache, then we will increase the time required when extending partial solutions to attribute E, as can be seen as follows: B may take a value b, then we reset the cache when B takes a new value b; but then it can take the value b again, when A has changed. Thus, dropping B from the cache key may require us to redo some work. This increases the time complexity and it also complicates the time analysis of the algorithm. We describe now this technique in general.

Definition 19.

A pseudo-tree with caching and resets (PTCR) of a query Q is a pair (P,C), where P=(𝐕,E) is a pseudo-tree and C is a function C:𝐕.

Fix a variable A𝑽, and let its context be 𝑐𝑜𝑛(A)={A1,,An}; recall that 𝑐𝑜𝑛(A)𝑎𝑛𝑐(A). We order 𝑐𝑜𝑛(A) such that A1 is closest to the root and An is closest to A. The function C in Definition 19 indicates how many variables from 𝑐𝑜𝑛(A) will be stored simultaneously. If k:=min(C(A),|𝑐𝑜𝑛(A)|), we partition 𝑐𝑜𝑛(A) into 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A)𝑐𝑜𝑛𝑆𝑡𝑜(A), where 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A):={A1,,Ank} is the instantiated context and 𝑐𝑜𝑛𝑆𝑡𝑜(A):={Ank+1,,An} is the stored context. The keys of the cache MA will always agree on 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A) but may differ on 𝑐𝑜𝑛𝑆𝑡𝑜(A). Any change of a variable in 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A) invalidates (resets) MA. We use a bar to indicate the partition of 𝑐𝑜𝑛(A): in Example 18, if C(E)=1, then we write 𝑐𝑜𝑛(E)=AB|D. If C(A)=0 then it is equivalent to A having no cache.

A basic algorithm for handling resets described in [11] is as follows. Each variable A has a cache MA with key 𝑐𝑜𝑛(A), and an instantiated tuple 𝑐𝑜𝑛𝐼𝑛𝑠𝑡A𝐝𝐨𝐦𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A) storing the last value of 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A). When trying to extend a partial solution 𝒚 to A, we first check whether 𝑐𝑜𝑛𝐼𝑛𝑠𝑡A=𝒚[𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A)]. If yes, the cache can be used like in Section 4.4. If not, then the cache MA has to be reset. However, this algorithm is not optimal, as we explain next.

Example 20.

Consider the Boolean query Q() in Figure 3 with bag semantics and the PTCR (P,C) in Figure 4. The figure also shows the partitions of each context. For example, 𝑐𝑜𝑛(E)=B|D, means that 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(E)=B and 𝑐𝑜𝑛𝑆𝑡𝑜(E)=D, and therefore the keys of its cache ME(BD) always agree on B; on the other hand, D has a full cache MD(BC). To determine the time complexity at variable E, we need to reason about how often the cache ME is reset due to B changing its value. We can do this in two ways. Either we notice that the only ancestor of B is A and, thus, the number of attempts to extend partial solutions to E with a new B is bounded by ρ(AB). Or, we notice that D has a fully stored cache MD(BC), and extensions to E are only tried with unique BC pairs, yielding the bound ρ(BC).

These bounds can be reduced to ρ(B) by computing the cache MD(BC) eagerly. When trying to extend a partial solution abc to D for the first time, D will ignore the values bc, and instead it fills its cache MD(BC) entirely with all values of BC: it iterates over all distinct values bc of BC for the subquery Q[BC] restricted to BC and stores the result for every value d of D (which includes the iteration over the values of E) in MD(bc). D traverses the subquery Q[BC] by grouping on B (e.g., by sorting it lexicographically), so that the same B-values occur consecutively, e.g. b1c1,b1c2,b1c3,b2c1, When B changes from b1 to b2, E resets its cache, but there is no loss of work, because b1 will never be seen again; this is similar to the argument in Example 18. The number of cache resets is reduced333In this simple example, we have ρ(AB)=ρ(BC)=ρ(B)=1. Hence, the improved algorithm does not reduce the runtime but the dependency. However, when also considering the time required to iterate through the E-loop, we get ρ(BE)=1<ρ(ABE)=2 and <ρ(BCE)=1.5. to ρ(B). This example was simple, because D had no instantiated variables, 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(D)=; the general case requires the technical Definition 21 below. Notice that filling the cache eagerly is a significant extension of GJ and all its implementations in practice [34, 14], where the values of AB are examined in strict lexicographic order, e.g. a1b1,a1b2,a2b1,a2b2 Instead, we expect the values of B at E in sorted order b1,b1,b2,b2,b3,

In general, to extend query evaluation based on 𝒫𝒯𝒞 to 𝒫𝒯𝒞, we use the following:

Definition 21.

For a PTCR (P,C) and variable A𝐕(P), we define the (closed) relevant (instantiated) ancestors 𝑟𝑎¯(A),𝑟𝑎(A),𝑟𝑖𝑎(A) – where con¯(A)𝑟𝑎¯(A)anc¯(A),𝑐𝑜𝑛(A)𝑟𝑎(A)𝑎𝑛𝑐(A), and (for 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A)) 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A)𝑟𝑖𝑎(A)anc¯(min(𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A))) – recursively as follows:

𝑟𝑖𝑎(A) ={𝑟𝑎¯(parent(A))anc¯(min(𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A)))𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A),𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A)=,
𝑟𝑎(A) =𝑟𝑖𝑎(A)𝑐𝑜𝑛𝑆𝑡𝑜(A),𝑟𝑎¯(A)=𝑟𝑎(A){A}.

Intuitively, the instantiated relevant context 𝑟𝑖𝑎(A) determines the number of resets of the cache MA: on one hand, it contains the instantiated context 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A). Clearly, for every different value combination of the attributes in 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A), we have to fill the cache MA again from scratch. On the other hand, when the ancestors of 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A) take different values, then 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A) may later take the same value combination again. Thus, the total number of cache resets of MA depends on the possible value combinations of 𝑐𝑜𝑛𝐼𝑛𝑠𝑡 and the possible number of repetitions of the same value combinations of 𝑐𝑜𝑛𝐼𝑛𝑠𝑡. To bound this, 𝑟𝑖𝑎(A) lies between 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A) and their ancestors (anc¯(min(𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A)))), and crucially satisfies the property that the partial instantiations 𝒚𝐝𝐨𝐦anc¯(A) that “arrive” at A come in lexicographic order even when projected onto 𝑟𝑖𝑎(A). Hence, we can use ρ(𝑟𝑖𝑎(A)) to determine the number of cache resets.

As we have alluded to before, maintaining this lexicographic order does not come for free but requires the caches to be computed eagerly. That is, if we inductively assume 𝑟𝑖𝑎(A) to come lexicographically, then go through 𝑐𝑜𝑛𝑆𝑡𝑜(A) lexicographically, and then also go though A lexicographically, then 𝑟𝑎¯(A) is given to each child lexicographically. The problem with the naive approach (i.e., the lazy computation) is that an ancestor of A between 𝑐𝑜𝑛𝐼𝑛𝑠𝑡(A) and A may potentially destroy the lexicographic order in which 𝑐𝑜𝑛𝑆𝑡𝑜(A) should be processed and is passed to the children. Referring to Example 20, when trying to extend partial solutions to D, we have 𝑟𝑖𝑎(D)=. We, therefore, iterate only once over all values bc of Q[BC]. Hence, the bcd partial assignments (BCD=𝑟𝑎¯(D)) arrive at E lexicographically. The cache ME at E is only reset when b changes, i.e., the relevant variables are 𝑟𝑖𝑎(E)=BCDAB=B. Thus, to bound the time spent at E we can use ρ(𝑟𝑎¯(E))=ρ(BDE)=1.5.

We next define the class of query plans 𝒫𝒯𝒞 together with their space-time exponents:

Definition 22.

The class of query plans 𝒫𝒯𝒞(Q) for a query Q consists of PTCR (P,C) of Q. If Q is a Boolean query, then the space and time exponents of a 𝒫𝒯𝒞(Q) (P,C) are defined as:

s(P,C)=maxAV(P)ρ(𝑐𝑜𝑛𝑆𝑡𝑜(A)),t(P,C)=maxAV(P)ρ(𝑟𝑎¯(A)).
Theorem 23.

Let Q be a Boolean query. If (P,C)𝒫𝒯𝒞(Q), then we can compute Q based on (P,C) in O(|D|s(P,C)) space and in O(|D|t(P,C)) time.

4.5 Pseudo-Trees Using Recursion to Reorient Sub-Trees

We now present a final extension of pseudo-trees termed recursive pseudo-trees 𝒫𝒯 in [12]. They are motivated by the following observation: In a 𝒫𝒯𝒞-algorithm based on the PTCR (P,C), for an attribute A with C(A)0 and where a cache miss occurs, we evaluate, for every instantiation 𝒚sto of the stored context 𝑐𝑜𝑛𝑆𝑡𝑜(A), the subquery of Q restricted to the variables desc¯(A) and cache the result in MA. The results (over all 𝒚sto) then make up the cache MA(𝑐𝑜𝑛(A)). Hence, actually, we can see MA(𝑐𝑜𝑛(A)) as a query itself where we have simply already fixed some variables (also some of 𝑐𝑜𝑛(A) are fixed). Intuitively, we aim to solve the subquery

MA(𝑐𝑜𝑛(A))Q[𝑟𝑎¯(A)desc¯(A)]

but where the values of 𝑟𝑖𝑎(A) are fixed to some partial assignment 𝒚ria. Hence, it only remains to go though the variables 𝑐𝑜𝑛𝑆𝑡𝑜(A)desc¯(A). The 𝒫𝒯𝒞-based algorithm does exactly this and proceeds as follows: First, it iterates through the variables in 𝑐𝑜𝑛𝑆𝑡𝑜(A) and, then, it proceeds to the variables in desc¯(A) according to (P,C). The variables in 𝑐𝑜𝑛𝑆𝑡𝑜(A) are thus processed in the order they are given as ancestors of A in P. While intuitive, this is an arbitrary decision. One could instead simply use a different PTCR (P,C) – imposing a different order on the remaining variables 𝑐𝑜𝑛𝑆𝑡𝑜(A)desc¯(A) – to compute this subquery. Effectively, we fill the cache using a different PTCR and see this as replacing the subtree of (P,C) rooted at A with the new sub-plan (P,C).

Figure 5: Query .
Figure 6: An RPT for .
Example 24.

To motivate the use of different PTCRs to fill the caches, consider the Boolean query () given in Figure 5 with bag semantics. As there are many 5-cliques, our aim is to achieve time complexity 2.5 and minimize the space complexity. Note the structure of the query: L is connected to everything, 𝒮1=LDE and 𝒮2=LHG are the minimal non-trivial separators, and 𝒦1=LBDC,𝒦2=LFEG,𝒦3=LHJI are three 4-cliques which each extend in two ways to a 5-clique – 𝒦1 together with A or E, as well as 𝒦2 together with D or H, and 𝒦3 together with G or K. Thus, a natural way of evaluating would be to start like a 𝒫𝒯𝒞 plan. That is, we start with a path 𝒦2:LFEG of nested loops and then branch to the separators 𝒮1:D and 𝒮2:H separately.

Let us focus on the left branch where we continue with, say, C. At this point, we need a cache to not increase the time complexity beyond 2.5. We set the size of the cache to 2 (the space complexity will be 1 but the cache contains 2 variables), thus get the context partition con(C)=L|ED. Now we would have to fill the cache for the possible values of 𝑐𝑜𝑛𝑆𝑡𝑜(C)=ED that fit to the current value l of L, and then solve the remaining query on A,B,C. Thus, the query to solve is

MC(l,E,D)Q[l,A,B,C,D,E]

This can be done by a loop structure that first extends l to values bdc and then loops through A and E independently. Such a loop structure will take time O(N2.5) and space O(N) including the loop over the values l. Naturally, the right branch can be taken care of symmetrically. Thus, we have arrived at an algorithm with the desired space and time consumption. However, note that this algorithm is not the result of a 𝒫𝒯𝒞 plan as this is not the way how a 𝒫𝒯𝒞 algorithm would have filled the cache of C (no matter how we complete the PTCR). Crucially, we have inverted the order of E and D to fill the cache.

Figure 6 depicts an RPT that follows the same idea of the sketch of an algorithm above. That is, the RPT starts out as a PTCR (solid edges) but where a different PTCR is used to fill the caches at C and J. To that end, these sub-parts (the gray parts) are replaced by the PTCRs attached with dashed edges. The red L indicates the fixed inputs that the new PTCRs have to take into consideration and the blue ED (resp. GH) are the output variables of the subquery.

The definition of recursive pseudo-trees and the analysis of their time complexity are quite involved. We, therefore, omit them here and refer the interested reader to [12]. Suffice it to mention that 𝒫𝒯 plans strictly dominate 𝒫𝒯𝒞 plans, which is seen as follows: We clearly have 𝒫𝒯𝒫𝒯𝒞, since 𝒫𝒯-plans without recursion are simply 𝒫𝒯𝒞 plans. On the other hand, we have 𝒫𝒯𝒞𝒫𝒯, as illustrated in Example 24.

5 Combining the Two Worlds

Having discussed query plans based on decompositions in Section 3 and based on various variants of pseudo-trees in Section 4, we now consider their combination. That is, we study classes of query plans which, on one hand, use tree decompositions and, on the other hand, use query plans from some class 𝒞 for evaluating the subqueries in each bag. We denote the resulting class of query plans as 𝒯𝒟𝒞. More specifically, we will have a closer look at the classes 𝒯𝒟𝒢𝒥, 𝒯𝒟𝒫𝒯, 𝒯𝒟𝒫𝒯𝒞, and 𝒯𝒟𝒫𝒯𝒞, which combine tree decompositions with plans in the classes 𝒢𝒥, 𝒫𝒯, 𝒫𝒯𝒞, and 𝒫𝒯𝒞, respectively, from Section 4.

5.1 Tree Decompositions and Generic Join

We have already observed in Section 3 that the space-time exponents of 𝒯𝒟𝒢𝒥 plans are s(T,χ)=max(u,v)E(T)ρ(χ(u)χ(v)) and t(T,χ)=maxvV(T)ρ(χ(v)); the time exponent is equal to the fractional hypertree-width of the query, if (T,χ) is the TD underlying an FHD of minimum width. We, therefore, concentrate here on a comparison with other classes of query plans. Of course, the relationship 𝒯𝒟𝒞𝒞 holds for any class 𝒞 of query plans, since we can simply consider the trivial tree decomposition consisting of a single bag. Below we show that 𝒫𝒯 and 𝒯𝒟𝒢𝒥 are incomparable.

Theorem 25.

The classes 𝒫𝒯 and 𝒯𝒟𝒢𝒥 of query plans are incomparable, i.e., 𝒫𝒯𝒯𝒟𝒢𝒥 and 𝒯𝒟𝒢𝒥𝒫𝒯.

Proof Sketch.

To show 𝒫𝒯𝒯𝒟𝒢𝒥, we revisit the 4-path query Q()R1(A,B)R2(B,C)R3(C,D) from Example 12 under bag semantics. We have seen that a 𝒫𝒯-plan can evaluate this query with space-time exponents (0,2). Now consider a TD with three bags χ(u)={AB}, χ(v)={BC}, χ(w)={CD}, where u is the root. Then a 𝒯𝒟𝒢𝒥-plan achieves space-time exponents (1,1). Clearly, time exponent 1 is not feasible with a 𝒫𝒯-plan.

On the other hand, to show 𝒯𝒟𝒢𝒥𝒫𝒯, consider again the 3-path query from Example 8. We have seen in Example 8 that it can be evaluated by a 𝒫𝒯-plan with space-time exponents (0,1). A 𝒯𝒟𝒢𝒥-plan cannot achieve this, since it either has time exponent = 2 (for a TD with a single bag) or space exponent 1 (for a TD with 2 bags).

5.2 Tree Decompositions and Pseudo-Trees with or without Caching

In Theorem 25, we have established the relationships 𝒫𝒯𝒯𝒟𝒢𝒥 and 𝒯𝒟𝒢𝒥𝒫𝒯. Together with the trivial relationship 𝒯𝒟𝒫𝒯𝒯𝒟𝒢𝒥, we thus also have 𝒯𝒟𝒫𝒯𝒯𝒟𝒢𝒥. Actually, in [12], even a slightly stronger result was shown: recall from Example 8 that not only 𝒢𝒥𝒫𝒯 holds, but, for the 3-path query, a 𝒫𝒯-plan can even achieve a strictly smaller time exponent without increasing the space exponent. Similarly, there exists a (more involved) query, for which the optimal time exponent with a 𝒯𝒟𝒢𝒥 plan can be improved by a 𝒯𝒟𝒫𝒯 plan without increasing the space exponent. For details, see [12].

Below, we present two results on 𝒫𝒯𝒞-plans: on one hand, even with decompositions, 𝒫𝒯𝒞 dominates 𝒯𝒟𝒢𝒥. On the other hand, if we combine tree decompositions with 𝒫𝒯𝒞-plans for evaluating the subqueries at the bags (i.e., we have plans in the class 𝒯𝒟𝒫𝒯𝒞), we do not get an improvement over 𝒯𝒟𝒫𝒯-plans.

Theorem 26.

The class 𝒫𝒯𝒞 dominates 𝒯𝒟𝒢𝒥, i.e., 𝒫𝒯𝒞𝒯𝒟𝒢𝒥.

Proof Sketch..

Given a plan Π:=(T,χ)𝒯𝒟𝒢𝒥, we construct a plan Π0:=(P,𝑪)𝒫𝒯𝒞 such that Π0Π. Note that, by slight abuse of notation, we denote query plans in 𝒯𝒟𝒢𝒥 by only writing the TD and not explicitly specifying the query plan for every bag χ(v). In case of 𝒢𝒥 this is justified since any variable order leads to the same time exponent, namely the fractional edge cover number ρ(χ(v)). The construction is based on the variable elimination procedure for a tree decomposition [23], and proceeds by induction on the number of bags in T. If T has a single bag, then Π is essentially a 𝒢𝒥 plan, and the claim follows from 𝒫𝒯𝒢𝒥.

Otherwise, let v be a leaf of T, let p:=𝑝𝑎𝑟𝑒𝑛𝑡(v), and let {A1,,Ak}:=χ(v)χ(p), i.e., the set of variables that occur in v but nowhere else. Let 𝒁 be their neighbors, i.e., 𝒁:={B atom Ri(𝑿i),j, s.t. Aj,B𝑿i}. Then, 𝒁χ(v)χ(p) must hold. Let Q be the query obtained from Q by removing all variables A1,,Ak, and adding a new atom R(𝒁), i.e., QQ[𝑣𝑎𝑟(Q){A1,,Ak}](𝑿)R(𝒁). Clearly, the plan Π=(T,χ) obtained from Π by removing the leaf v is a 𝒯𝒟𝒢𝒥-plan for Q. Hence, by the induction hypothesis, Π can be converted to a 𝒫𝒯𝒞 plan Π0=(P,𝑪) such that Π0Π. All variables 𝒁 belong to a branch of Π0 (because of the atom R(𝒁), that we have “artificially” included into Q). Construct the pseudo-tree P from P by adding a branch A1-A2--Ak as a child of the last variable in 𝒁. Finally, define Π0:=(P,𝑪{A1}) (only A1 receives a cache). It can be checked that Π0Π: for the space exponent, note that 𝑐𝑜𝑛(A1)=𝒁 is the only additional cache in Π0 compared with Π. By 𝒁χ(v)χ(p), its space exponent is not bigger than ρ(χ(v)χ(p)). For the time exponent, we note that filling the cache at A1 (by considering query Q restricted to 𝒁{A1,,Ak}) does not require more time than evaluating the subquery of Q restricted to the bag χ(v)𝒁{A1,,Ak}.

Recall from Theorem 25 that 𝒫𝒯 and 𝒯𝒟𝒢𝒥 are incomparable. Together with the trivial relationship 𝒫𝒯𝒞𝒫𝒯, we may conclude from Theorem 26 the strict domination relationships 𝒫𝒯𝒞𝒫𝒯 and 𝒫𝒯𝒞𝒯𝒟𝒢𝒥.

The crucial step in the proof of Theorem 26 was to eliminate one node v from the tree decomposition and to cover the interface between this node and its parent by a newly introduced cache. In the next theorem, we essentially proceed in the opposite direction: given a 𝒯𝒟𝒫𝒯𝒞, we want to eliminate a cache at some variable A in the 𝒫𝒯𝒞-plan for evaluating the subquery corresponding to a bag at a node v in the tree decomposition. Now, the crucial step is to split the bag at node v into two bags (one with the variables at the subtree rooted at A plus its cache and one with the remaining variables of the bag but again adding the cache at A). The details are worked out in [12]. We thus get:

Theorem 27.

The class 𝒯𝒟𝒫𝒯 dominates 𝒯𝒟𝒫𝒯𝒞, i.e., 𝒯𝒟𝒫𝒯𝒯𝒟𝒫𝒯𝒞. Therefore, 𝒯𝒟𝒫𝒯𝒯𝒟𝒫𝒯𝒞 and 𝒯𝒟𝒫𝒯𝒫𝒯𝒞.

5.3 Tree Decompositions and Pseudo-Trees with Caching and Resets

Figure 7: Query .

In the previous section, we have seen that combining TDs with 𝒫𝒯-plans for the subqueries at the bags dominates the combination of TDs with 𝒢𝒥-plans. On the other hand, replacing 𝒫𝒯-plans by 𝒫𝒯𝒞-plans for the subqueries at the bags of a TD does not allow for further improvements. The natural next question is as to whether the use of the yet more powerful 𝒫𝒯𝒞-plans in combination with TDs has the potential for further improvements. In this section, we give a positive answer to this question indirectly. More specifically, we illustrate that 𝒫𝒯𝒞-plans and 𝒯𝒟𝒫𝒯-plans are incomparable. Together with the trivial domination relationship 𝒯𝒟𝒫𝒯𝒞𝒫𝒯𝒞, we may then conclude that 𝒯𝒟𝒫𝒯𝒞𝒯𝒟𝒫𝒯 holds.

Theorem 28.

The classes 𝒫𝒯𝒞 and 𝒯𝒟𝒫𝒯 of query plans are incomparable, i.e., 𝒫𝒯𝒞𝒯𝒟𝒫𝒯 and 𝒯𝒟𝒫𝒯𝒫𝒯𝒞.

Proof Sketch.

For 𝒫𝒯𝒞𝒯𝒟𝒫𝒯, we use the query () depicted in Figure 2 and the 𝒫𝒯𝒞 given in Example 18, with space-time exponents (1,2). Because no edge separates the query, any TD with 2 or more bags uses super-linear space, and a single bag is equivalent to a PT, which takes more than quadratic time.

For 𝒯𝒟𝒫𝒯𝒫𝒯𝒞, we use the query () depicted in Figure 7 and a TD with three bags ABCDE, DEFGH, and GHIJK. Its space-time exponents are (1,2): the space exponent is clear by considering the intersections by DE and GH between neighboring bags; for the time exponent of the first bag, we could, for instance, use a PT starting with path A-B-C and then branching into D and E, respectively. Then both branches have ρ=2. The subqueries at the other two bags are evaluated analogously. On the other hand, it can be shown that the best 𝒫𝒯𝒞 for the query () has space-time exponents of (1.5,2) or (1,2.5). This result, presented in [12], was obtained by a computer-assisted exhaustive search for 𝒫𝒯𝒞-plans.

5.4 Tree Decompositions and Pseudo-Trees with Recursion

We now also briefly look at the combination of TDs with 𝒫𝒯-plans for the subqueries at the bags. It turns out that this may lead to a further improvement compared with 𝒯𝒟𝒫𝒯𝒞-plans. Actually, even 𝒫𝒯-plans without combining them with TDs strictly dominate 𝒯𝒟𝒫𝒯𝒞-plans. We first show that 𝒯𝒟𝒫𝒯𝒞𝒫𝒯 holds.

Theorem 29.

The class 𝒯𝒟𝒫𝒯𝒞 does not dominate 𝒫𝒯, i.e., 𝒯𝒟𝒫𝒯𝒞𝒫𝒯.

Proof Sketch.

To prove 𝒯𝒟𝒫𝒯𝒞𝒫𝒯, we revisit the Boolean query Q depicted in Figure 5. As was discussed in Example 24, this query can be evaluated by an 𝒫𝒯-plan with space-time exponent (1,2.5). However, using a computer-assisted exhaustive search of the plan space 𝒫𝒯𝒞, it was verified in [12] that there is no plan PTCR (P,C) with a space exponent of s(P,C)1 and time exponent of t(P,C)5/2. Since there is also no linear separator in this query, this implies that the same holds for 𝒯𝒟𝒫𝒯𝒞.

Finally, we mention that the combination of 𝒫𝒯-plans with TDs does not provide further improvements compared with pure 𝒫𝒯-plans, i.e., 𝒫𝒯𝒯𝒟𝒫𝒯 holds. For details, see [12]. Together with the trivial domination relationship 𝒯𝒟𝒫𝒯𝒫𝒯, we thus get 𝒫𝒯𝒯𝒟𝒫𝒯. Moreover, by 𝒯𝒟𝒫𝒯𝒯𝒟𝒫𝒯𝒞 and Theorem 29, we get the strict domination relationship 𝒫𝒯𝒯𝒟𝒫𝒯𝒞.

6 Conclusion

We have recalled query plans based on decomposition techniques, which have received a lot of attention in the database community, and query plans based on pseudo-trees and their extensions, which have been primarily studied in the constraint satisfaction community. Moreover, we have shown that techniques from both areas can be fruitfully combined by considering tree decompositions and applying pseudo-tree techniques to the subqueries at the bags of the decompositions. The comparison of the various query plans in terms of space-time exponents yields the domination relationships depicted in Figure 8.

Name Class of Query Plans Based On:
𝒢𝒥 Generic-Join
𝒫𝒯 Pseudo-Tree
𝒫𝒯𝒞 Pseudo-Tree with Caching
𝒫𝒯𝒞 Pseudo-Tree with Caching and Reset
𝒫𝒯 Recursive Pseudo-Tree
𝒯𝒟𝒞 Tree-Decomposition, with a query plan from 𝒞 applied to each bag
Figure 8: [12] Classes of query plans, ordered by their space-time exponents: lower classes have smaller exponents and are better. An arrow 𝒞2𝒞1 means that every plan in 𝒞2 can be mapped to a plan in 𝒞1 with space-time exponents at least as good; in particular, 𝒞1𝒞2 (see Definition 2). A missing arrow, i.e. 𝒞2↛𝒞1, means 𝒞1𝒞2. In particular, all downward arrows indicate strict domination. The depicted graphs are examples of Boolean queries with binary predicates that separate the classes; the colors represent maximal cliques.

As far future work is concerned, the widest open field is the lack of lower bounds – both in terms of space and time exponents: We have recalled several classes of query plans together with their “canonical algorithms”, which lead to upper bounds on the space-time exponents. There are no formal proofs that these space-time exponents are optimal for the respective classes of query plans. More generally, we are lacking concrete space-time tradeoffs for (conjunctive) query evaluation, and there is little to built on in the literature. For example, the set difference and distinct element problems have been proven to have a lower bound ST=Ω(n2) [5, 28]. However, these results are too weak to constrain query evaluation, since even acyclic CQs require at least a quadratic space-time product.

References

  • [1] Christopher R. Aberger, Andrew Lamb, Susan Tu, Andres Nötzli, Kunle Olukotun, and Christopher Ré. Emptyheaded: A relational engine for graph processing. ACM Trans. Database Syst., 42(4):20:1–20:44, 2017. doi:10.1145/3129246.
  • [2] Isolde Adler, Georg Gottlob, and Martin Grohe. Hypertree width and related hypergraph invariants. Eur. J. Comb., 28(8):2167–2181, 2007. doi:10.1016/j.ejc.2007.04.013.
  • [3] Albert Atserias, Martin Grohe, and Dániel Marx. Size bounds and query plans for relational joins. In 49th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2008, October 25-28, 2008, Philadelphia, PA, USA, pages 739–748. IEEE Computer Society, 2008. doi:10.1109/FOCS.2008.43.
  • [4] Albert Atserias, Martin Grohe, and Dániel Marx. Size bounds and query plans for relational joins. SIAM J. Comput., 42(4):1737–1767, 2013. doi:10.1137/110859440.
  • [5] Paul Beame. A general sequential time-space tradeoff for finding unique elements. SIAM J. Comput., 20(2):270–277, 1991. doi:10.1137/0220017.
  • [6] 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. doi:10.14778/3742728.3742737.
  • [7] Altan Birler, Alfons Kemper, and Thomas Neumann. Robust join processing with diamond hardened joins. Proc. VLDB Endow., 17(11):3215–3228, 2024. doi:10.14778/3681954.3681995.
  • [8] Angela Bonifati, Wim Martens, and Thomas Timm. An analytical study of large SPARQL query logs. VLDB J., 29(2-3):655–679, 2020. doi:10.1007/s00778-019-00558-9.
  • [9] Chandra Chekuri and Anand Rajaraman. Conjunctive query containment revisited. Theor. Comput. Sci., 239(2):211–229, 2000. doi:10.1016/S0304-3975(99)00220-0.
  • [10] Rina Dechter. Constraint Processing. Morgan Kaufmann Publishers, 2003.
  • [11] Rina Dechter. Reasoning with Probabilistic and Deterministic Graphical Models: Exact Algorithms, Second Edition. Synthesis Lectures on Artificial Intelligence and Machine Learning. Morgan & Claypool Publishers, 2019. doi:10.2200/S00893ED2V01Y201901AIM041.
  • [12] Kyle Deeds, Timo Camillo Merkl, Reinhard Pichler, and Dan Suciu. The space-time complexity of sum-product queries. CoRR, abs/2509.11920, 2025. Full version of a paper accepted by PODS 2026. doi:10.48550/arXiv.2509.11920.
  • [13] Wolfgang Fischl, Georg Gottlob, Davide Mario Longo, and Reinhard Pichler. Hyperbench: A benchmark and tool for hypergraphs and empirical findings. ACM J. Exp. Algorithmics, 26:1.6:1–1.6:40, 2021. doi:10.1145/3440015.
  • [14] Michael J. Freitag, Maximilian Bandle, Tobias Schmidt, Alfons Kemper, and Thomas Neumann. Adopting worst-case optimal joins in relational database systems. Proc. VLDB Endow., 13(11):1891–1904, 2020. URL: http://www.vldb.org/pvldb/vol13/p1891-freitag.pdf.
  • [15] Eugene C. Freuder and Michael J. Quinn. Taking advantage of stable sets of variables in constraint satisfaction problems. In Aravind K. Joshi, editor, Proceedings of the 9th International Joint Conference on Artificial Intelligence. Los Angeles, CA, USA, August 1985, pages 1076–1078. Morgan Kaufmann, 1985. URL: http://ijcai.org/Proceedings/85-2/Papers/082.pdf.
  • [16] Georg Gottlob, Matthias Lanzinger, Reinhard Pichler, and Igor Razgon. Complexity analysis of generalized and fractional hypertree decompositions. J. ACM, 68(5):38:1–38:50, 2021. doi:10.1145/3457374.
  • [17] Georg Gottlob, Nicola Leone, and Francesco Scarcello. Hypertree decompositions and tractable queries. J. Comput. Syst. Sci., 64(3):579–627, 2002. doi:10.1006/jcss.2001.1809.
  • [18] Georg Gottlob, Zoltán Miklós, and Thomas Schwentick. Generalized hypertree decompositions: NP-hardness and tractable variants. J. ACM, 56(6):30:1–30:32, 2009. doi:10.1145/1568318.1568320.
  • [19] Johnnie Gray and Stefanos Kourtis. Hyper-optimized tensor network contraction. Quantum, 5:410, 2021. doi:10.22331/Q-2021-03-15-410.
  • [20] Martin Grohe and Dániel Marx. Constraint solving via fractional edge covers. ACM Trans. Algorithms, 11(1):4:1–4:20, 2014. doi:10.1145/2636918.
  • [21] Sunwoong Joo, Attila Dusnoki, Martyn Bliss, Ben Duckworth, Nicolas Scotto Di Perto, Markó Fabó, Gábor Lóki, Dániel Vince, Ákos Kiss, and Cheul-hee Hahm. A memory-aware performance optimization of tensor programs for embedded devices. In 2020 IEEE International Conference on Consumer Electronics-Asia (ICCE-Asia), pages 1–4. IEEE, 2020.
  • [22] Manolis Katsaragakis, Lazaros Papadopoulos, Mario Konijnenburg, Francky Catthoor, and Dimitrios Soudris. Memory footprint optimization techniques for machine learning applications in embedded systems. In IEEE International Symposium on Circuits and Systems, ISCAS 2020, Sevilla, Spain, October 10-21, 2020, pages 1–4. IEEE, 2020. doi:10.1109/ISCAS45731.2020.9181038.
  • [23] Mahmoud Abo Khamis, Hung Q. Ngo, and Atri Rudra. FAQ: questions asked frequently. CoRR, abs/1504.04044, 2015. arXiv:1504.04044.
  • [24] Phokion G. Kolaitis and Moshe Y. Vardi. Conjunctive-query containment and constraint satisfaction. J. Comput. Syst. Sci., 61(2):302–332, 2000. doi:10.1006/JCSS.2000.1713.
  • [25] Matthias Lanzinger, Cem Okulmus, Reinhard Pichler, Alexander Selzer, and Georg Gottlob. Soft and constrained hypertree width. Proc. ACM Manag. Data, 3(2):114:1–114:25, 2025. doi:10.1145/3725251.
  • [26] Matthias Lanzinger, Reinhard Pichler, and Alexander Selzer. Avoiding materialisation for guarded aggregate queries. Proc. VLDB Endow., 18(5):1398–1411, 2025. URL: https://www.vldb.org/pvldb/vol18/p1398-selzer.pdf.
  • [27] Stanislav Malyshev, Markus Krötzsch, Larry González, Julius Gonsior, and Adrian Bielefeldt. Getting the most out of wikidata: Semantic technology usage in wikipedia’s knowledge graph. In Denny Vrandecic, Kalina Bontcheva, Mari Carmen Suárez-Figueroa, Valentina Presutti, Irene Celino, Marta Sabou, Lucie-Aimée Kaffee, and Elena Simperl, editors, The Semantic Web - ISWC 2018 - 17th International Semantic Web Conference, Monterey, CA, USA, October 8-12, 2018, Proceedings, Part II, volume 11137 of Lecture Notes in Computer Science, pages 376–394. Springer, 2018. doi:10.1007/978-3-030-00668-6_23.
  • [28] Dylan M. McKay and Richard Ryan Williams. Quadratic time-space lower bounds for computing natural functions with a random oracle. In Avrim Blum, editor, 10th Innovations in Theoretical Computer Science Conference, ITCS 2019, January 10-12, 2019, San Diego, California, USA, volume 124 of LIPIcs, pages 56:1–56:20. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPIcs.ITCS.2019.56.
  • [29] Hung Q. Ngo, Christopher Ré, and Atri Rudra. Skew strikes back: new developments in the theory of join algorithms. SIGMOD Rec., 42(4):5–16, 2013. doi:10.1145/2590989.2590991.
  • [30] Samyam Rajbhandari, Olatunji Ruwase, Jeff Rasley, Shaden Smith, and Yuxiong He. Zero-infinity: breaking the GPU memory wall for extreme scale deep learning. In Bronis R. de Supinski, Mary W. Hall, and Todd Gamblin, editors, International Conference for High Performance Computing, Networking, Storage and Analysis, SC 2021, St. Louis, Missouri, USA, November 14-19, 2021, page 59. ACM, 2021. doi:10.1145/3458817.3476205.
  • [31] Neil Robertson and Paul D. Seymour. Graph minors. II. algorithmic aspects of tree-width. J. Algorithms, 7(3):309–322, 1986. doi:10.1016/0196-6774(86)90023-4.
  • [32] Francesco Scarcello, Gianluigi Greco, and Nicola Leone. Weighted hypertree decompositions and optimal query plans. J. Comput. Syst. Sci., 73(3):475–506, 2007. doi:10.1016/J.JCSS.2006.10.010.
  • [33] Kian-Lee Tan, Qingchao Cai, Beng Chin Ooi, Weng-Fai Wong, Chang Yao, and Hao Zhang. In-memory databases: Challenges and opportunities from software and hardware perspectives. SIGMOD Rec., 44(2):35–40, 2015. doi:10.1145/2814710.2814717.
  • [34] Todd L. Veldhuizen. Triejoin: A simple, worst-case optimal join algorithm. In Nicole Schweikardt, Vassilis Christophides, and Vincent Leroy, editors, Proc. 17th International Conference on Database Theory (ICDT), Athens, Greece, March 24-28, 2014, pages 96–106. OpenProceedings.org, 2014. doi:10.5441/002/ICDT.2014.13.
  • [35] 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.
  • [36] Mihalis Yannakakis. Algorithms for acyclic database schemes. In Proceedings VLDB, pages 82–94. VLDB, 1981.