Query Decompositions and All That
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, ComplexityCategory:
Invited TalkCopyright and License:
2012 ACM Subject Classification:
Theory of computation Database theory ; Information systems Query languagesFunding:
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 FunkSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
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 on the size of the database. Then the time and space complexity of using an (optimal) FHD is essentially (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.
Example 1.
Consider the query
over some database of size . In Figure 1, we graphically display this query and show three different query plans:
-
The first one evaluates by using a tree decomposition with bags and in a straightforward way. That is, we first evaluate and materialize the subqueries restricted to the bags (in time and space , where the exponent corresponds to the fractional edge cover number of the triangle query, and then intersect the two results on .
-
The next plan applies the Generic Join algorithm. Here, we have to fix a variable order – say – 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 , where the exponent corresponds to the fractional edge cover number of the query .
-
The last plan uses a pseudo-tree with root node and then branches into and , respectively. Here we make use of the fact that, for every value of , we may evaluate the subqueries restricted to and to independently. We thus achieve 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 , if the “canonical” evaluation algorithm executing the query plan has space complexity and time complexity , where is a bound on the size of the database. For instance, as fundamentally different approaches we have Generic Join plans with and plans using a (tree) decomposition and WCOJ to evaluate and materialize the subqueries at each bag with . 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 . 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 ’s are the result of these selections. Alternatively, we denote CQs in Datalog-style notation and write them as
| (1) |
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 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 () and (tuples of) domain values by lowercase letters (). We will also refer to variables as attributes when this is more appropriate. We write and to denote the set of variables in and the set of atoms in , respectively, i.e., and . 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 to denote the (finite) set of domain values actually occurring in attribute in the given database , i.e., the active domain of .
Unless mentioned otherwise, we consider set semantics. Then the semantics of in Eq. (1) on a database is the relation defined as
Sometimes, we will switch to bag semantics. Then the semantics of in Eq. (1) on a database is a mapping , which assigns to every the cardinality . We will mostly consider Boolean queries and, in this case, under bag semantics we have to count the number of tuples that satisfy the right hand side of Eq. (1). We may omit the superscript when it is clear from the context, and simply write , .
Let be a set of variables. A fractional edge cover of (with respect to ) is a weight function , such that, for every variable , . The fractional edge cover number of , denoted , is the minimum value of attainable by fractional edge covers of . Due to [4], we know that is an upper bound on the number of tuples that satisfy the query restricted to the variables 111Formally, we mean that for every there has to exist an such that ..
A CQ is called acyclic (an ACQ, for short), if it has a join tree, i.e., a labeled tree with node-labeling function such that (1) for every relation there exists exactly one node of with and (2) satisfies the so-called connectedness condition, i.e., if some attribute occurs in both relations and for two nodes of , then occurs in the relation for every node on the path between and .
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 be a node in with child nodes of and let relations , be associated with the nodes , at some stage of the computation. Then we set
-
(1)
,
-
(2)
for every , and
-
(3)
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 of . 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 of .
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 on the number of tuples in the given database . We consider a query plan for a query as a structure that is associated with a specific algorithm for evaluating , e.g., in case of an ACQ , 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 as . Each plan is associated with a space exponent and a time exponent . The latter bounds the associated algorithm’s runtime by . The former bounds the space used by the algorithm by , excluding the space required to store the input relations. We refer to these jointly as space-time exponents .
Definition 2 (Plan Domination).
Let be two plans for the same query . We say improves over , or that dominates , denoted , if and . We say that strictly dominates , denoted , if but not vice versa. We may write , if both and hold.
A class of plans improves over (dominates) another class , denoted , if for every query , it holds that , such that . We say that strictly dominates , denoted , if holds but not vice versa. We may write if both and 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 , a tree decomposition (TD, for short) of is a tuple where is a directed tree and is a node-labeling function that assigns a set of variables to every node, satisfying the following conditions:
-
1.
for every , there exists a node ;
-
2.
for every , the nodes with form a connected subset of .
The sets are called bags. The width of a TD is the maximum size of its bags minus 1, i.e., . The tree-width of a CQ is defined as the minimum width attainable by a TD of , i.e., . 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 by making use of a TD is to compute and materialize, for every node , the query restricted to the variables in the bag 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 corresponding to each bag. Clearly, there is a choice as to what plan we use to compute the subqueries . The most naive evaluation consists in associating with each bag with variables the relation obtained by computing the query restricted to those atoms which are covered by 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 , we compute the subquery , where the index sets and are defined as and and with , respectively. We can then transform into an equivalent ACQ and evaluate this ACQ by applying Yannakakis’ algorithm to it. The space and time exponents of this approach are essentially (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 , a hypertree decomposition (HD, for short) of is a tuple where is a tree decomposition and 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:
-
3.
for every , the atoms in are an integral edge cover of , i.e., ;
-
4.
for every , the so-called “special condition” holds, i.e., let denote the subtree rooted at , then .
The width of an HD is the maximum size of its -labels, i.e., . The hypertree-width of a CQ is defined as the minimum width attainable by an HD of , i.e., . Note that the fourth condition in Definition 4 was introduced in [17] only to make the problem of deciding, if holds, tractable for fixed . 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 as the associated width measure [2]. Clearly, GHDs generalize HDs and holds for every CQ . The downside of GHDs is that even deciding if for given query holds, is NP-complete [18, 16].
Bounded hw and bounded ghw generalize acyclicity in that ACQs are precisely the CQs with . 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 . That is, for every , we compute the subquery . The resulting ACQ can then be evaluated by applying Yannakakis’ algorithm. We thus get the space-time exponents and , 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 , a fractional hypertree decomposition (FHD, for short) of is a tuple , where is a tree decomposition and , satisfying (in addition to the properties of TDs according to Definition 3) the following condition:
-
3.
for every , is a fractional edge cover of , i.e., , such that, for every , .
The width of an FHD is defined as the maximum weight of its -labels, i.e., . The fractional hypertree-width of a CQ is defined as the minimum width attainable by an FHD of , i.e., . In order to turn a CQ with given FHD into an ACQ, we need to evaluate the query restricted to the variables in for every , i.e., . By using a WCOJ method such as Generic Join [29], the maximal output size and the time for evaluating such a query over a database is . The resulting ACQ can then be evaluated by Yannakakis’ algorithm, leading to the space-time exponents [20].
For every CQ , we clearly have . Hence, treating a TD as an FHD and evaluating the subqueries at each bag by some WCOJ techniques in order to turn 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 of a TD , we thus associate a query as follows. Let and or, if is the root node, then . Then we compute, in a bottom-up traversal of the TD, the queries
Using a WCOJ method such as Generic Join for evaluating each of these subqueries, we end up with the space-time exponents and . The latter is equal to , if 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 of a given CQ and computes iteratively partial assignments on , for all . It starts with the empty assignment and, in nested loops, it extends it to one variable after the other, as follows. Assuming a partial assignment , the ’th nested loop iterates through all values in to extend to a partial assignment . Here, we write to denote the set of values of attribute in relation restricted to those tuples that coincide with on all attributes in . 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 is a total order on its variables, . We denote by (resp. ) the set of all Generic Join plans (of ). In case of a Boolean query , the space-time exponents of any are .
Theorem 7 ([29]).
Let be a Boolean query. If , then we can compute based on in space and time given by . Concretely, the space used is (i.e., constant), and the time spent is .
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 . The bag semantics of is obtained as . By slight abuse of notation, we are writing for the indicator expression , which takes the value 1 if contains the tuple and which is 0 otherwise. GJ proceeds in 3 nested loops, e.g., for the variable ordering , GJ computes the expression , with runtime , i.e., the time exponent is . A pseudo-tree based algorithm, in contrast, iterates over first, then performs two independent loops that iterate over and respectively; this corresponds to the expression , and the runtime is , 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 is the root and are its children, i.e., .
To formally define and analyze pseudo-tree algorithms, we introduce the following notation: For a directed tree and , we denote by the set of ancestors of excluding , and write . Similarly, we write and for the set of descendants of , without and with respectively.
Definition 9 ([15, 11]).
A pseudo-tree (PT) of a query is a directed tree , such that every atom is contained in a branch: formally, such that .
Definition 10.
The class of query plans of a query consists of pseudo-trees of . In case of a Boolean query , the space-time exponents of any are
Pseudo-tree plans strictly dominate GJ plans, i.e. , because any variable order of a GJ can be converted into a linear PT , 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 be a Boolean query. If , then we can compute based on in space and time given by . Concretely, the space used is (i.e., constant), and the time spent is with .
Theorem 11 is based on an algorithm that simply uses a loop structure that mimics the pseudo-tree . That is, the top-most loop iterates through the possible values for the variable at the root . Then, there is an independent nested loop for each child of 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 , the loops above it fix a partial assignment which is then extended by a value to the partial assignment . Iterating over the smallest of these sets and probing in the other, the time at is determined by (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 under bag semantic, and consider the linear PT , where is the root. The runtime of this plan is given by the AGM bound [3], . Intuitively, this query plan corresponds to the summation 222As in Example 8, we are writing for the indicator expression , which takes the value 1 if contains the tuple and which is 0 otherwise.. We note that the subexpression is independent of , and, by caching the values , we can avoid recomputing this expression for different values . Similarly, we can cache . By adding caches, we can trade space for time. In our example, filling the cache for all possible values of requires at most linear time. Likewise, filling the cache for all possible values of can be done in linear time, i.e.: we have to iterate through all tuples but, due to caching, we only need to iterate once through all tuples . Hence, the two caches and decrease the runtime of the PT given above from to , while the space increases from to .
Suppose that we want to store the results for possible extensions of partial solutions to the attribute in a cache . The key of is called the context of , defined as follows.
Definition 13 ([11]).
The context of a variable is defined as
and the closed context of is .
The main property of is that the subquery corresponding to the subtree (of the pseudo-tree) rooted at does not depend on the instantiation of all ancestors of but only on the instantiation of the variables in . Therefore, we can cache these values in a cache with key , whose values are subsets of (equivalently, mappings ) or mappings for set and bag semantics, respectively. Hence, the type of this cache is or , respectively, which is equivalent to or , respectively. Therefore, the space usage of the cache is given by as each cached tuple satisfies the query restricted to variables .
To determine the time spent by the algorithm at node , suppose that some uses a cache, and let be closest to with this property. Moreover, suppose that we want to extend a partial solution to the attribute for some instantiation of and later for another instantiation of . Further, let . Then, and must have both resulted in a cache miss at . However, this only happens the first time the partial instantiation is considered. Thus, and must be the same partial instantiation and we can essentially ignore in the computation of the time spent at . Let be the variables along the path connecting to . Put differently, at the values of the variables are unique and they are the only variables of relevant to the time consumption by the loop at .
Example 14.
Let us compute the space-time usage of plans for the 5-path for three different cache setups. We always use the linear PT . Without a cache, we simply compute with space and time usage. The worst time usage is at and given by . With a cache at , we compute and with space and time usage. The worst time usage is again given at but computed as . Lastly, when we add caches at and as well, we compute , , , and , resulting in space and 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 is a pair , where is a PT of , and is a subset of the variables for which we add a cache. We require .
Definition 16.
The class of query plans of a query consists of pseudo-trees with caching of . If is a Boolean query, then the space and time exponents of a plan are defined as:
where , i.e., the node in closest to with a cache.
Pseudo-trees with caches strictly dominate pseudo-trees, i.e. , because a -plan with no caches (i.e., ), is simply a -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 be a Boolean query. If , then we can compute based on in space and time .
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].
Example 18.
To motivate resetting caches, consider the query in Figure 2 with bag semantics and the PT . Adding caches to leads to space-time exponents of . For example, the cache for variable has key , and its space usage is given by . When extending a partial solution to attribute , the result is stored in . Later, if has changed while are the same, the result can be retrieved from the cache. Note that, once the value of or changes, we can safely discard (or reset) all entries , because the values are processed in lexicographic order. We can, therefore, reduce the space of the cache by only keeping cached entries whose keys agree on – essentially only storing the results for different values of . This decreases the space usage of to , and similarly for the cache . With this “reset” improvement, can be computed with space-time exponents .
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 from the query , then the context of attribute becomes . If we now drop from the cache, then we will increase the time required when extending partial solutions to attribute , as can be seen as follows: may take a value , then we reset the cache when takes a new value ; but then it can take the value again, when has changed. Thus, dropping 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 is a pair , where is a pseudo-tree and is a function .
Fix a variable , and let its context be ; recall that . We order such that is closest to the root and is closest to . The function in Definition 19 indicates how many variables from will be stored simultaneously. If , we partition into , where is the instantiated context and is the stored context. The keys of the cache will always agree on but may differ on . Any change of a variable in invalidates (resets) . We use a bar to indicate the partition of : in Example 18, if , then we write . If then it is equivalent to having no cache.
A basic algorithm for handling resets described in [11] is as follows. Each variable has a cache with key , and an instantiated tuple storing the last value of . When trying to extend a partial solution to , we first check whether . If yes, the cache can be used like in Section 4.4. If not, then the cache has to be reset. However, this algorithm is not optimal, as we explain next.
Example 20.
Consider the Boolean query in Figure 3 with bag semantics and the PTCR in Figure 4. The figure also shows the partitions of each context. For example, , means that and , and therefore the keys of its cache always agree on ; on the other hand, has a full cache . To determine the time complexity at variable , we need to reason about how often the cache is reset due to changing its value. We can do this in two ways. Either we notice that the only ancestor of is and, thus, the number of attempts to extend partial solutions to with a new is bounded by . Or, we notice that has a fully stored cache , and extensions to are only tried with unique pairs, yielding the bound .
These bounds can be reduced to by computing the cache eagerly. When trying to extend a partial solution to for the first time, will ignore the values , and instead it fills its cache entirely with all values of : it iterates over all distinct values of for the subquery restricted to and stores the result for every value of (which includes the iteration over the values of ) in . traverses the subquery by grouping on (e.g., by sorting it lexicographically), so that the same -values occur consecutively, e.g. When changes from to , resets its cache, but there is no loss of work, because 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 . Hence, the improved algorithm does not reduce the runtime but the dependency. However, when also considering the time required to iterate through the -loop, we get and . to . This example was simple, because had no instantiated variables, ; 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 are examined in strict lexicographic order, e.g. Instead, we expect the values of at in sorted order
In general, to extend query evaluation based on to , we use the following:
Definition 21.
For a PTCR and variable , we define the (closed) relevant (instantiated) ancestors – where and (for ) – recursively as follows:
Intuitively, the instantiated relevant context determines the number of resets of the cache : on one hand, it contains the instantiated context . Clearly, for every different value combination of the attributes in , we have to fill the cache again from scratch. On the other hand, when the ancestors of take different values, then may later take the same value combination again. Thus, the total number of cache resets of depends on the possible value combinations of and the possible number of repetitions of the same value combinations of . To bound this, lies between and their ancestors (), and crucially satisfies the property that the partial instantiations that “arrive” at come in lexicographic order even when projected onto . Hence, we can use 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 to come lexicographically, then go through lexicographically, and then also go though lexicographically, then is given to each child lexicographically. The problem with the naive approach (i.e., the lazy computation) is that an ancestor of between and may potentially destroy the lexicographic order in which should be processed and is passed to the children. Referring to Example 20, when trying to extend partial solutions to , we have . We, therefore, iterate only once over all values of . Hence, the partial assignments () arrive at lexicographically. The cache at is only reset when changes, i.e., the relevant variables are . Thus, to bound the time spent at we can use .
We next define the class of query plans together with their space-time exponents:
Definition 22.
The class of query plans for a query consists of PTCR of . If is a Boolean query, then the space and time exponents of a are defined as:
Theorem 23.
Let be a Boolean query. If , then we can compute based on in space and in 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 , for an attribute with and where a cache miss occurs, we evaluate, for every instantiation of the stored context , the subquery of restricted to the variables and cache the result in . The results (over all ) then make up the cache . Hence, actually, we can see as a query itself where we have simply already fixed some variables (also some of are fixed). Intuitively, we aim to solve the subquery
but where the values of are fixed to some partial assignment . Hence, it only remains to go though the variables . The -based algorithm does exactly this and proceeds as follows: First, it iterates through the variables in and, then, it proceeds to the variables in according to . The variables in are thus processed in the order they are given as ancestors of in . While intuitive, this is an arbitrary decision. One could instead simply use a different PTCR – imposing a different order on the remaining variables – to compute this subquery. Effectively, we fill the cache using a different PTCR and see this as replacing the subtree of rooted at with the new sub-plan .
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 and minimize the space complexity. Note the structure of the query: is connected to everything, and are the minimal non-trivial separators, and are three 4-cliques which each extend in two ways to a 5-clique – together with or , as well as together with or , and together with or . Thus, a natural way of evaluating would be to start like a plan. That is, we start with a path of nested loops and then branch to the separators and separately.
Let us focus on the left branch where we continue with, say, . At this point, we need a cache to not increase the time complexity beyond . We set the size of the cache to (the space complexity will be but the cache contains 2 variables), thus get the context partition . Now we would have to fill the cache for the possible values of that fit to the current value of , and then solve the remaining query on . Thus, the query to solve is
This can be done by a loop structure that first extends to values and then loops through and independently. Such a loop structure will take time and space including the loop over the values . 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 (no matter how we complete the PTCR). Crucially, we have inverted the order of and 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 and . To that end, these sub-parts (the gray parts) are replaced by the PTCRs attached with dashed edges. The red indicates the fixed inputs that the new PTCRs have to take into consideration and the blue (resp. ) 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 and ; the time exponent is equal to the fractional hypertree-width of the query, if 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 from Example 12 under bag semantics. We have seen that a -plan can evaluate this query with space-time exponents . Now consider a TD with three bags , , , where is the root. Then a -plan achieves space-time exponents . 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 . 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 , we construct a plan such that . 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 . In case of this is justified since any variable order leads to the same time exponent, namely the fractional edge cover number . The construction is based on the variable elimination procedure for a tree decomposition [23], and proceeds by induction on the number of bags in . If has a single bag, then is essentially a plan, and the claim follows from .
Otherwise, let be a leaf of , let , and let , i.e., the set of variables that occur in but nowhere else. Let be their neighbors, i.e., . Then, must hold. Let be the query obtained from by removing all variables , and adding a new atom , i.e., Clearly, the plan obtained from by removing the leaf is a -plan for . Hence, by the induction hypothesis, can be converted to a plan such that . All variables belong to a branch of (because of the atom , that we have “artificially” included into ). Construct the pseudo-tree from by adding a branch as a child of the last variable in . Finally, define (only receives a cache). It can be checked that : for the space exponent, note that is the only additional cache in compared with . By , its space exponent is not bigger than . For the time exponent, we note that filling the cache at (by considering query restricted to ) does not require more time than evaluating the subquery of restricted to the bag .
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 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 in the -plan for evaluating the subquery corresponding to a bag at a node in the tree decomposition. Now, the crucial step is to split the bag at node into two bags (one with the variables at the subtree rooted at plus its cache and one with the remaining variables of the bag but again adding the cache at ). 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
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 . Because no edge separates the query, any TD with 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 , , and . Its space-time exponents are : the space exponent is clear by considering the intersections by and 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 . 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 or . 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 depicted in Figure 5. As was discussed in Example 24, this query can be evaluated by an -plan with space-time exponent . However, using a computer-assisted exhaustive search of the plan space , it was verified in [12] that there is no plan PTCR with a space exponent of and time exponent of . Since there is also no linear separator in this query, this implies that the same holds for .
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 |
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 [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.
