<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Tractable Counting of the Answers to Conjunctive Queries</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Reinhard</forename><surname>Pichler</surname></persName>
							<email>pichler@dbai.tuwien.ac.at</email>
							<affiliation key="aff0">
								<orgName type="institution">Technische Universität Wien</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Sebastian</forename><surname>Skritek</surname></persName>
							<email>skritek@dbai.tuwien.ac.at</email>
							<affiliation key="aff0">
								<orgName type="institution">Technische Universität Wien</orgName>
							</affiliation>
						</author>
						<title level="a" type="main">Tractable Counting of the Answers to Conjunctive Queries</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">0E7668C6D1D4B7B8447147CC6E34176E</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T15:43+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Conjunctive queries (CQs) are one of the most fundamental forms of database queries. In general, the evaluation of CQs is NPcomplete. Consequently, there has been an intensive search for tractable fragments. In this paper, we want to initiate a systematic search for tractable fragments of the counting problem of CQs, i.e., the problem of counting the answers to a CQ. We prove several new tractability and intractability results by starting with acyclic conjunctive queries and generalising these results to CQs of bounded hypertree-width.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>Conjunctive queries (CQs) are one of the most fundamental forms of database queries. They correspond to select-project-join queries in relational algebra and to select-from-where queries in SQL. As such, they are the primary target of most current query optimisation techniques. Moreover, CQs are closely related to Constraint Satisfaction Problems (CSPs) <ref type="bibr" target="#b13">[14]</ref>, which play an important role in artificial intelligence and reasoning. By slight abuse of notation, we consider CQ evaluation as a decision problem. Strictly speaking, there are several (interreducible) decision problems related to CQ evaluation, like query containment or asking if a given CQ has at least one solution over some database or asking if a given tuple is part of the answer of the CQ over some database, etc.</p><p>Without any restrictions, the evaluation of CQs (and, likewise, solving CSPs) is NP-complete (query complexity) <ref type="bibr" target="#b2">[3]</ref>. Consequently, there has been an intensive search for tractable fragments. Acyclic conjunctive queries (ACQs) <ref type="bibr" target="#b18">[19]</ref> have thus played an important role. The most common characterisation of ACQs is in terms of join trees (for details, see Section 2). ACQs can be evaluated efficiently by performing solely semi-joins in a bottom-up traversal of the join tree. Meanwhile, many further tractable classes of CQs have been identified. In particular, many structural decomposition methods have been developed which are based on some notion of decomposition of the graph or hypergraph structure underlying a conjunctive query and which are used to define some notion of width. Hypertree decompositions, which are used to define the hypertree-width of a CQ, are a very powerful decomposition method (for details, see Section 2) <ref type="bibr" target="#b10">[11]</ref>. In particular, CQs can be efficiently evaluated if their hypertree-width is bounded by some constant. The class of CQs of bounded hypertree-width generalises many other tractable fragments of CQs <ref type="bibr" target="#b8">[9]</ref> like CQs of bounded tree-width <ref type="bibr" target="#b16">[17]</ref>, CQs of bounded query-width <ref type="bibr" target="#b3">[4]</ref>, and also ACQs. Indeed, ACQs are precisely the CQs whose hypertree-width is equal to 1.</p><p>In this paper, we concentrate on the counting problem related to CQ evaluation, i.e., the problem of counting the number of answers to a CQ. We shall refer to this problem as the #CQ problem. Of course, the #CQ problem is intractable. Indeed, it is #P-complete for CQs with free variables only (i.e., no existential quantifiers) and even slightly harder (namely # • NP-complete) in the general case <ref type="bibr" target="#b0">[1]</ref>. Interestingly, the search for tractable fragments of #CQ has received very little attention so far even though the count operator is an integral part of the SQL language and is supported by virtually any relational database management system. Very recently, we have shown by an ad hoc algorithm that the query complexity of #CQ becomes tractable for CQs of bounded tree-width <ref type="bibr" target="#b15">[16]</ref>. However, a systematic search for tractable fragments of #CQ is completely missing to date. In this paper, we want to close this gap. Our goal is to arrive at a situation comparable to the well-studied decision problem of CQ evaluation, i.e., (i) we want to establish tractability for ACQs, (ii) the corresponding algorithms should be based on semi-joins, and (iii) it should be possible to generalise the tractability results to CQs of bounded hypertree-width.</p><p>Organisation of the paper and summary of results. In Section 2, we recall some basic notions and results. A conclusion is given in Section 6. The main results of the paper are detailed in Sections 3 -5, namely:</p><p>• ACQs with free variables only. In Section 3, we restrict ourselves to ACQs with free variables only. We present our basic algorithm for counting the answers to ACQs of this specific form. Our algorithm only requires semi-joins and simple arithmetic. We thus establish the tractability of the combined complexity of #CQ for ACQs without existential quantifiers.</p><p>• Arbitrary ACQs. In Section 4, we consider #CQ for arbitrary ACQs. The tractability of the data complexity is easily shown. For the query complexity, a significant extension of the basic algorithm from Section 3 is required. In contrast, for the combined complexity of the #CQ problem for arbitrary ACQs we establish the intractability by proving its #P-completeness.</p><p>• Extensions. All tractability and intractability results discussed above immediately carry over to CQs of bounded hypertree-width. In Section 5, we discuss further extensions and applications of our results. For instance, the #Pcompleteness of the combined complexity of the counting problem of ACQs allows us an easy #P-completeness proof for the counting problem of unions of ACQs even if these ACQs have no existentially quantified variables at all.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Preliminaries</head><p>Schemas and instances. A relational schema R = {R 1 , . . . , R n } is a set of relation symbols R i each of a fixed arity k and with an assigned sequence of k attributes (A 1 , . . . , A k ). An instance I over a schema R consists of a relation R I i for each relation symbol R i ∈ R, s.t. both have the same arity. We only consider finite instances here, and denote with dom(I) the active domain of I. We write x for a tuple (x 1 , . . . , x n ). By slight abuse of notation, we also refer to the set {x 1 , . . . , x n } as x. Hence, we may use expressions like x i ∈ x or x ⊆ X, etc. For a tuple s ∈ R I i , we also say R i (s) ∈ I. CQs. A conjunctive query (CQ) Q on a database schema R is of the form Q : ans(x) ← ∃yφ(x, y), where φ(x, y) = n i=1 r i is a conjunction of atoms r i = R j (z), s.t. R j ∈ R with arity k, and z ⊆ x ∪ y with |z| = k. We do not consider constants in the query, because a simple preprocessing step allows us to get rid of them. For the same reason, w.l.o.g. we assume no variable to occur twice in any atom <ref type="bibr" target="#b9">[10]</ref>. The free variables x are also referred to as distinguished variables, while the existentially quantified variables y are often called nondistinguished variables. We denote with atoms(Q) the set {r 1 , . . . , r n } of atoms appearing in Q, and for a set A of atoms, var (A) denotes the set of variables occurring in A. By slight abuse of notation, for a tuple x = (x 1 , . . . , x n ) of variables and a mapping µ : x → dom(I), we write µ(x) for (µ(x 1 ), . . . , µ(x n )). A tuple s is called an answer or solution to a CQ Q on an instance I if s = µ(x), where µ : x ∪ y → dom(I) is a variable assignment on x, y, s.t. for every atom R i (z) ∈ atoms(Q), R i (µ(z)) ∈ I. For such a mapping µ, we also write µ(Q) ⊆ I to emphasise that every atom R i (z) ∈ atoms(Q) is sent to an atom in I. The set Q(I) of answers to Q on I is a relation ans Q(I) containing all answers.</p><p>In this paper, we study the counting problem #CQ, which is defined as follows: Given a conjunctive query Q over some relational schema R and an instance I for R, how many tuples are contained in ans Q(I) ?</p><p>ACQs. There exist several notions of acyclic CQs (ACQs). We restrict ourselves here to the so-called α-acyclicity <ref type="bibr" target="#b6">[7]</ref>. One way to characterise ACQs is via join trees, i.e., a CQ is acyclic, if it has a join tree <ref type="bibr" target="#b6">[7]</ref>. A join tree T for a query Q is a tree T = (V, E), where V is identified with the set of atoms in Q, and E is such that for every two atoms r i , r j ∈ V having variables in common, all atoms on the unique path from r i to r j contain all variables shared by r i and r j . Given a CQ it can be efficiently checked if it is acyclic, and if so, also a join tree can be computed efficiently <ref type="bibr" target="#b11">[12,</ref><ref type="bibr" target="#b19">20]</ref>. We often identify a tree T with its vertex set V , and write t ∈ T for T = (V, E), t ∈ V . If we want to stress the difference between the graph structure and the query atoms, for some t ∈ T for a join tree T , we write Q t to denote the query atom identified with node t. Further, given an instance I to evaluate Q on, for every t ∈ T we denote with R t the relation R I i assigned to the relation symbol of Q t . Hypertree decompositions. A hypertree decomposition <ref type="bibr" target="#b10">[11]</ref> of a CQ Q is a triple T, χ, λ , where T = (V, E) is a tree and χ, λ are mappings χ : V → P(var (atoms(Q))) and λ :</p><formula xml:id="formula_0">V → P(atoms(Q)) s.t. (1) for each atom r i ∈ atoms(Q), there exists a v ∈ V s.t. var ({r i }) ⊆ χ(v); (2) for each z ∈ var (atoms(Q)), the set T = {v ∈ V | z ∈ χ(v)} of T induces a connected subtree of T ; (3) for each v ∈ V , χ(v) ⊆ var (λ(v)); (4) for each v ∈ V , var (λ(v)) ∩ χ(T v ) ⊆ χ(v),</formula><p>where T v ⊆ T is the complete subtree of T rooted at v. The width of a hypertree decomposition is max v∈V |λ(v)|, and the hypertree-width of Q is the minimum width over all hypertree decompositions of Q. For a given width ω, the existence of a hypertree decomposition of width ω can be efficiently decided, and a decomposition can be efficiently computed, if one exists <ref type="bibr" target="#b10">[11]</ref>.</p><p>Counting complexity. While decision problems ask if for a given problem instance, at least one solution exists, counting problems ask how many different solutions exist, see e.g. <ref type="bibr" target="#b14">[15]</ref>, Chap. 18. The most intensively studied counting complexity class is #P, which contains those function problems which consist in counting the number of accepting computation paths of a non-deterministic polynomial-time Turing machine. In other words, #P captures the counting problems corresponding to decision problems in NP. However, there exist also #P-complete problems for which the corresponding decision problem is easy. Classical examples of this "easy to decide, hard to count" phenomenon are #PERFECT MATCHINGS and 2-SAT <ref type="bibr" target="#b17">[18]</ref>: checking if a bipartite graph has a perfect matching or if a 2-CNF formula has a model is easy. But counting the number of perfect matchings or the number of models of a 2-CNF-formula is hard. Note that by #P-completeness we mean completeness w.r.t. Cook reductions, i.e., polynomial-time Turing reductions <ref type="bibr" target="#b14">[15]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">ACQs without Nondistinguished Variables</head><p>We first consider CQs of the form ans(x) ← φ(x), i.e. only queries that contain no existentially quantified variables. Without further restrictions, #CQ is well known to be #P-complete for CQs of this form <ref type="bibr" target="#b4">[5]</ref>. However, just as for the decision problem, for ACQs, we can make use of the existence of a join tree to guide the computation. We provide an algorithm, mainly working with semijoins along the join tree, that shows that the problem is indeed tractable for ACQs. Note that we consider counting w.r.t. set semantics here.</p><p>Before describing the algorithm, we have to fix some notation. Given an acyclic CQ Q : ans(x) ← φ(x) over database schema R and instance I, let T be a join tree of Q. Recall that for t ∈ T , Q t denotes the query atom identified with t, and R t the relation R I i assigned to the relational symbol of Q t . Further let T t be the complete subtree of T rooted at t, and let X t = var ({Q t }). For Q t = R i (x 1 , . . . , x k ), if clear from the context, it is convenient to also write Q t to refer to (x 1 , . . . , x k ) only. For a subtree T of T , X T = t∈T X t and Q T = t∈T Q t . Given Q T , the subquery defined by Q T is the query ans(X T ) ← t∈T Q t . In the following, we always assume an acyclic CQ Q : ans(x) ← φ(x) with join tree T to be evaluated over some database instance I.</p><p>Obviously, every row in R t encodes a variable assignment α on X t , hence a partial assignment on x. The idea of the algorithm is to compute, for every t ∈ T , in a bottom-up traversal of the tree the number of possible extensions µ of α to X Tt that are valid solutions to the subquery defined by Q Tt . Formally, for a mapping µ : X Tt → dom(I) and some t ∈ T , we define the footprint of µ on t as fpr (µ, t) = α, where α is a variable assignment on X t s.t. α(x i ) = µ(x i ) for all x i ∈ X t . For a subtree T ⊆ T with root t and α : X t → dom(I), we define the set N (T , t, α) = {µ : X T → dom(I) | fpr (µ, t) = α and µ(Q T ) ⊆ I} of all possible extensions of the variable assignment α to an assignment µ on the variables X T that are solutions to the subquery Q T . The intuition behind this set is that for every row ρ ∈ R t (which can be considered as a variable assignment α on X t ), N (T t , t, α) contains all possible extensions of α to X Tt that are solutions to Q Tt .</p><p>As we cannot afford to compute this set explicitly (which would be the naive algorithm), we just compute and store its cardinality, i.e. |N (T t , t, α)|. Hence, at each node t ∈ T we maintain a table Rt , having |X t | + 1 columns. Thereby the first |X t | columns (denoted as Rt,π(Xt) ) store α, while the last column stores |N (T t , t, α)|. To better distinguish between |N (T t , t, α)|, i.e. the value intended to be stored in this column, and the actual value present there, we refer to this column (or value) as c α . Note that we are only interested in such assignments α s.t. N (T t , t, α) = ∅, because otherwise α can never be extended to an answer to Q. Hence, for every assignment α s.t. α(Q t ) / ∈ R t , we need no entry in Rt , and therefore Rt contains exactly one row for every ρ ∈ R t s.t. |N (T t , t, α ρ )| &gt; 0. Thereby α ρ denotes the variable assignment defined by ρ. If clear from the context, we drop the ρ from α ρ and use α and ρ interchangeably.</p><p>It is easy to see that N (T t , t, α) ∩ N (T t , t, α ) = ∅ for α = α . Hence, the number of answers to the ACQ Q can be retrieved from the root node r of T , by just summing up the counter of all entries in Rr . Indeed, the union α∈Rr N (T r , r, α) gives all possible variable assignments µ on Initialisation Phase: For every leaf node t ∈ T , Rt is computed as follows: For every distinct tuple ρ ∈ R t , add a tuple (ρ, 1) to Rt . Note that for leaf nodes we have X t = X Tt . Hence, the only extension µ for each α is α itself, and Rt therefore contains the correct values.</p><formula xml:id="formula_1">X Tr = x s.t. µ(Q Tr ) = µ(Q) ⊆ I.</formula><p>Bottom-Up Traversal: Let t ∈ T be a node with children t 1 , . . . , t k (k ≥ 1), such that Rtj has already been computed during the bottom-up traversal for every j ∈ {1, . . . , k}. The idea is now to compute Rt by starting from a relation considering t only and then, step by step, for every j ∈ {1, . . . , k}, to include the subtree T j (where we use T j to abbreviate T tj ) by computing the semijoin between the output of the previous step and Rtj . Formally, let R0 t contain a tuple (ρ, 1) for every distinct tuple ρ ∈ R t , i.e. R0</p><p>t is defined analogously to Rt for a leaf node t ∈ T . Then, for every child j ∈ {1, . . . , k}, compute Rj t,π(Xt) = Rj−1 t,π(Xt) Rtj,π(Xt j ) . To compute c j α for every row in Rj t , we first define for every α ∈ Rj t,π(Xt) the set B α ⊆ Rtj,π(Xt j ) containing exactly those β ∈ Rtj,π(Xt) that can be joined with α, i.e.</p><formula xml:id="formula_2">B α = {β ∈ Rtj,π(Xt j ) | β(x i ) = α(x i ) for every x i ∈ X t ∩ X tj }. Then c j α for every row α ∈ Rj t,π(Xt) is set to c j α = c j−1 α • β∈Bα c β where c j−1 α is the value of c α in Rj−1 t . Finally, Rt = Rk t .</formula><p>The following example will help to illustrate this algorithm. <ref type="figure">1</ref>, where each of the nodes t ∈ {t 1 , . . . , t 5 } is annotated with Q t . In addition, the pattern of the relations shown at the leaf nodes is "R t ⇒ Rt ". At the two non-leaf nodes, the pattern is "R t ⇒ R0 t ⇒ R1 t ⇒ Rt ". The last column in each table contains the counter. The content of the relations is computed in a bottom-up manner as described above. The final result |Q(I)| = 9 can be read off at the root node.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Example 1. Consider an ACQ</head><formula xml:id="formula_3">Q : ans(x 1 , x 2 , x 3 , x 4 , x 5 , x 6 ) ← R 3 (x 3 ) ∧ R 4 (x 2 , x 4 , x 3 ) ∧ R 1 (x 1 , x 2 , x 3 ) ∧ R 2 (x 2 , x 3 ) ∧ R 2 (x 5 , x 6 ) and an instance I = {R 1 (s 1 , c 1 , b 1 ), R 1 (s 1 , c 1 , b 2 ), R 1 (s 3 , c 3 , b 1 ), R 1 (s 3 , c 1 , b 4 ), R 1 (s 2 , c 2 , b 3 ), R 2 (c 1 , b 2 ), R 2 (c 1 , b 1 ), R 2 (c 4 , b 6 ), R 3 (b 1 ), R 3 (b 2 ), R 4 (c 1 , a 1 , b 1 ), R 4 (c 1 , a 1 , b 2 ), R 4 (c 1 , a 2 , b 2 )} over the schema R = {R 1 /3, R 2 /2, R 3 /1, R 4 /3}. A possible join tree for Q is shown in Fig.</formula><formula xml:id="formula_4">t 1 : R 2 (x 2 , x 3 ) A 1 A 2 c 1 b 2 c 1 b 1 c 4 b 6 ⇒ x 2 x 3 c c 1 b 2 1 c 1 b 1 1 c 4 b 6 1 ⇒ x 2 x 3 c c 1 b 2 3 c 1 b 1 3 c 4 b 6 3 ⇒ x 2 x 3 c c 1 b 2 6 c 1 b 1 3 t 2 : R 2 (x 5 , x 6 ) A 1 A 2 c 1 b 2 c 1 b 1 c 4 b 6 ⇒ x 5 x 6 c c 1 b 2 1 c 1 b 1 1 c 4 b 6 1 t 3 : R 1 (x 1 , x 2 , x 3 ) A 1 A 2 A 3 s 1 c 1 b 1 s 1 c 1 b 2 s 3 c 3 b 1 s 3 c 1 b 4 s 2 c 2 b 3 ⇒ x 1 x 2 x 3 c s 1 c 1 b 1 1 s 1 c 1 b 2 1 s 3 c 3 b 1 1 s 3 c 1 b 4 1 s 2 c 2 b 3 1 ⇒ x 1 x 2 x 3 c s 1 c 1 b 1 1 s 1 c 1 b 2 1 s 3 c 3 b 1 1 ⇒ x 1 x 2 y c s 1 c 1 b 1 1 s 1 c 1 b 2 2 t 4 : R 3 (x 3 ) A 1 b 1 b 2 ⇒ x 3 c b 1 1 b 2 1 t 5 : R 4 (x 2 , x 4 , x 3 ) A 1 A 2 A 3 c 1 a 1 b 1 c 1 a 1 b 2 c 1 a 2 b 2 ⇒ x 2 x 4 x 3 c c 1 a 1 b 1 1 c 1 a 1 b 2 1 c 1 a 2 b 2 1</formula><p>Fig. <ref type="figure">1</ref>. Annotated join tree for the query Q (Example 1) over I.</p><p>Theorem 1. Suppose that we only consider ACQs Q : ans(x) ← φ(x) without nondistinguished variables. Then for query Q with join tree T over schema R and instance I, #CQ can be solved in time O(|Q| • (max t∈T |R t |) 2 ), assuming unit cost for arithmetic operations. Proof (sketch). First of all, it must be shown that the algorithm is indeed correct. This will be done implicitly in Section 4, where we present an algorithm for counting the number of solutions to an ACQ with nondistinguished variables and prove its correctness. As the algorithm presented above will turn out to be a special case of the one in Section 4, for the correctness we refer to the proof of Theorem 3.</p><p>It therefore remains to show the upper bound on the runtime of the algorithm: First of all, note that at each t ∈ T , Rt,π(Xt) ⊆ R t . Hence, at each node t ∈ T , the space required to store Rt is obviously in O(|R t |). On the other hand, by definition, the size of a join tree of Q is linear in the size of Q. Hence the space required to store Rt for all t ∈ T is trivially O(|Q| • max t∈T |R t |). Therefore, as even the naive implementation (with nested loops) of the semi-join needs only quadratic time, by assuming unit cost for the arithmetic operations, the runtime for the algorithm is in O(|Q| • (max t∈T |R t |) 2 ).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">ACQs with Nondistinguished Variables</head><p>For deciding whether a CQ has some solution, it makes no difference whether it contains only free variables, or additional nondistinguished ones. As the goal is just to find one assignment on all variables that maps the query into the instance, all variables can be treated in the same way. In contrast, for the counting problem, this is no longer true, as only variable assignments that differ on the free variables also give different solutions. On the other hand, variable assignments that only differ on the existentially quantified variables must not be counted twice. As already noted in the introduction, under reasonable complexity theoretical assumptions, in the general case, counting becomes harder for queries with nondistinguished variables <ref type="bibr" target="#b0">[1]</ref>. In this section, we show that a similar behaviour can be observed for ACQs: First we will show that the problem remains tractable for data-and query complexity, and then we show #P-completeness for the combined complexity.</p><p>Given an ACQ Q : ans(x) ← ∃yφ(x, y), the naive approach for counting the number of solutions over some instance I is to check for each possible variable assignment µ : x → dom(I), whether the (Boolean) ACQ Q : ans() ← ∃yφ(µ(x), y) is satisfied over I. As Q is acyclic, the check can be done in time O(|Q| • |I|) <ref type="bibr" target="#b18">[19,</ref><ref type="bibr" target="#b7">8]</ref> which immediately leads to tractable data complexity. When considering query complexity, tractability can be reached by some major extensions of the algorithm from the previous section. In the following, we will sketch the necessary changes. Recall that in the last section, given a CQ Q with join tree T on some schema R with instance I, the idea was, at each t ∈ T , to define a footprint (small enough to be stored) for every assignment µ : X Tt → dom(I), and to keep track of the number of partial solutions that have this footprint. Now we have to deal with assignments µ = µ x ∪ µ y with µ : X Tt ∪Y Tt → dom(I), where µ x and µ y are the restrictions of µ to X Tt and Y Tt resp., and Y t and Y Tt are defined on the nondistinguished variables analogously to X t and X Tt . Therefore we have fpr (µ x , µ y , t) = (α x , α y ) again as the restriction of µ x (resp. µ y ) to X t (resp. Y t ). However, this time the problem is that the same partial solution µ x may, with different µ y , have different footprints. Hence, if we define the sets N (T t , t, α x , α y ) of partial assignments (on the distinguished variables x) analogously as before, these sets are not necessarily disjoint. We therefore have to group footprints by α x , and identify sets of partial solutions by a combined footprint, which is a set of footprints {(α x , α 1 y ), . . . , (α x , α n y )}. For convenience, we may also write (α x , I) with I = {α 1 y , . . . , α n y } to denote the combined footprint.</p><p>For a subtree T t at node t ∈ T and a combined footprint (α x , I) at node t, we define N (T t , t, α x , I) as the set of mappings µ x : X Tt → dom(I) such that (1) for every i ∈ {1, . . . , |I|}, there exists a µ y : Y Tt → dom(I) s.t.</p><p>(a) fpr (µ x , µ y , t) = (α x , α i y ), and (b) µ(Q Tt ) ⊆ I (where µ = µ x ∪ µ y ) (2) for all μy : Y Tt → dom(I) s.t. µ(Q Tt ) ⊆ I (where µ = µ x ∪ μy ) holds, there exists a j ∈ {1, . . . , |I|} s.t. fpr (µ x , μy , t) = (α x , α j y )</p><p>As mentioned above, we cannot afford to store the set N (T t , t, α x , I) at node t ∈ T . Hence, we only store (α x , I) together with |N (T t , t, α x , I)|, since we are only interested in the number of such assignments. Note that (α x , I) fits into a table with |X t | + |Y t | columns (i.e. with schema (X t , Y t )), containing one row ρ i for every α i y ∈ I, storing α x in the first |X t | columns, and α i y in the last |Y t | columns. Hence at every node t ∈ T , we maintain a set RTt = { Ŝ1 , . . . , Ŝn } (for some n ∈ N; an upper bound on n will be given below) of relations of the above form. In addition, we maintain for each relation Ŝj ∈ RTt a counter c j t storing |N (T t , t, α x , I)|. Actually, it is convenient to write Rt short for RTt . Only for the correctness proof (in the full version) it will be advantageous to explicitly index R by a subtree T t rather than just by a node t. Intuitively, every relation Ŝj ∈ Rt encodes a set of mappings µ x : X Tt → dom(I), while each row in Ŝj encodes a different set of mappings µ y : Y Tt → dom(I) for this µ x , s.t. for each µ = µ x ∪ µ y , µ(Q Tt ) ⊆ I holds. Note that within each relation, each row has the same value for X t , and several relations may contain the same α x .</p><p>The content of Rt (for t ∈ T ) is again computed in two phases. In an initialisation phase, first for every leaf node t ∈ T , Rt contains exactly one relation for every different value α x for X t in R t , containing one row (α x , α y ) for every value α y for Y t s.t. (α x , α y ) ∈ R t . The counter for each such relation is set to one. Then, in a bottom-up traversal of the tree, for every t ∈ T with children t 1 , . . . , t k s.t. Rti has already been computed, we again start with some R0</p><p>t that is defined like Rt for leaf nodes t ∈ T , and then include one child after the other as follows: For i ∈ {1, . . . , k}, let Ri t contain all nonempty results Ŝ1 Ŝ2 for all pairs ( Ŝ1 ∈ Ri−1</p><formula xml:id="formula_5">t , Ŝ2 ∈ Rti ). If Ŝ1</formula><p>Ŝ2 is nonempty, the value of the counter for the resulting table is the product of the counters for Ŝ1 and Ŝ2 . Whenever several such pairs give the same result, only one copy of the relations is stored, and their counters are summed up. The number of solutions to Q is retrieved by summing up the counters for all Ŝj ∈ Rr at the root node r of T .</p><p>Example 2. Recall the instance I and query Q from Example 1. We will use the same instance I, and change Q to Q only by removing x 3 from the free variables.</p><p>(For convenience, we rename it to y.) I.e., Q : ans(x 1 , x 2 , x 4 , x 5 , x 6 ) ← ∃yR 3 (y)∧ R 4 (x 2 , x 4 , y) ∧ R 1 (x 1 , x 2 , y) ∧ R 2 (x 2 , y) ∧ R 2 (x 5 , x 6 ). We use the same join tree as before. It is shown in Fig. <ref type="figure" target="#fig_1">2</ref>, where again each node t ∈ {t 1 , . . . , t 5 } is annotated with Q t . Recall that to deal with nondistinguished variables, we have to maintain sets Rt of relations. At each node t, Rt is depicted together with its derivation sequence: The pattern shown at the leaf nodes is "R t ⇒ Rt ", and for the inner nodes it is "R t ⇒ R0 t ⇒ R1 t ⇒ Rt ". Thereby, the first row in each table shows the schema, followed by the relations Ŝj ∈ Ri t separated by double horizontal lines. In the first row for each relation Ŝj , the last column shows the counter for Ŝj . For instance, at node t 3 , we have two relations Ŝ1 = {(s 1 , c 1 , b 1 ), (s 1 , c 1 , b 2 )} and Ŝ2 = {(s 1 , c 1 , b 2 )} in Rt . Note that Ŝ1 and Ŝ2 refer to two different extensions of α x (x 1 , x 2 ) = (s 1 , c 1 ) to µ x (x 1 , x 2 , x 4 ). Indeed, Ŝ1 corresponds to µ x (x 4 ) = a 1 while Ŝ2 corresponds to µ x (x 4 ) = a 2 . Again, the final result |Q (I)| = 6 can be read off at the root node. Proof (sketch). The details of the algorithm and the correctness proof will be given in the full version. We only discuss the runtime here. Note that at some node t ∈ T , the values for X t need not be different between two different relations Ŝi , Ŝj ∈ Rt . Hence for every t ∈ T , there might be up to 2 m different elements in Rt , each of size O(m) (obviously, Ŝi ⊆ R t for every Ŝi ∈ Rt ), where m = max t∈T |R t |. Hence there are at most O((2 m ) 2 ) semi-joins between two nodes, each requiring time at most O(m 2 ) even for a naive implementation, which gives an overall runtime estimation</p><formula xml:id="formula_6">t 1 : R 2 (x 2 , y) A 1 A 2 c 1 b 2 c 1 b 1 c 4 b 6 ⇒ x 2 y c c 1 b 2 1 c 1 b 1 c 4 b 6 1 ⇒ x 2 y c c 1 b 2 3 c 1 b 1 c 4 b 6 3 ⇒ x 2 y c c 1 b 1 3 c 1 b 2 c 1 b 2 3 t 2 : R 2 (x 5 , x 6 ) A 1 A 2 c 1 b 2 c 1 b 1 c 4 b 6 ⇒ x 5 x 6 c c 1 b 2 1 c 1 b 1 1 c 4 b 6 1 t 3 : R 1 (x 1 , x 2 , y) A 1 A 2 A 3 s 1 c 1 b 1 s 1 c 1 b 2 s 3 c 3 b 1 s 3 c 1 b 4 s 2 c 2 b 3 ⇒ x 1 x 2 y c s 1 c 1 b 1 1 s 1 c 1 b 2 s 3 c 3 b 1 1 s 3 c 1 b 4 s 2 c 2 b 3 1 ⇒ x 1 x 2 y c s 1 c 1 b 1 1 s 1 c 1 b 2 s 3 c 3 b 1 1 ⇒ x 1 x 2 y c s 1 c 1 b 1 1 s 1 c 1 b 2 s 1 c 1 b 2 1 t 4 : R 3 (y) A 1 b 1 b 2 ⇒ y c b 1 1 b 2 t 5 : R 4 (x 2 , x 4 , y) A 1 A 2 A 3 c 1 a 1 b 1 c 1 a 1 b 2 c 1 a 2 b 2 ⇒ x 2 x 4 y c c 1 a 1 b 1 1 c 1 a 1 b 2 c 1 a 2 b 2 1</formula><formula xml:id="formula_7">of O(|Q| • m 2 • (2 m ) 2 ).</formula><p>Theorem 2 and Theorem 3 immediately imply that #CQ can be solved efficiently for data-and query complexity. The natural next question is, whether there exists also an algorithm that solves the problem efficiently when considering combined complexity. However, the next theorem shows that such an algorithm is very unlikely to exist. Theorem 4. Suppose that we only consider ACQs Q : ans(x) ← ∃yφ(x, y) with nondistinguished variables y. Then the combined complexity of #CQ is #P-complete. The problem remains #P-complete, even if Q contains a single nondistinguished variable only.</p><p>Proof (sketch). Membership is easy to show. The hardness is shown by reduction from the #P-complete problem #PERFECT MATCHINGS <ref type="bibr" target="#b17">[18]</ref>, i.e. from the problem of counting the number of perfect matchings in a bipartite graph. A Theorem 6. Suppose that we only consider CQs Q whose hypertree-width is bounded by some constant. Then the following holds: If Q contains no nondistinguished variables, then #CQ is polynomial time solvable (combined complexity).</p><p>On the other hand, if Q contains nondistinguished variables, then solving #CQ is feasible in polynomial time (data complexity and query complexity), while the problem is #P-complete (combined complexity).</p><p>Proof (idea). In <ref type="bibr" target="#b10">[11]</ref> it was shown that, given a Boolean CQ Q with hypertreewidth ω (for some constant ω) over some instance I, an equivalent ACQ Q over an instance I can be efficiently constructed, such that the combined size of Q and I is in O(|Q| • m ω ), where m = max Si∈I |S i |, and s.t. Q(I) returns true iff Q (I ) returns true. It is easy to verify that this construction preserves the number of solutions. Actually, even Q(I) = Q (I ) holds. Hence applying the results from the previous sections to Q and I proves the case.</p><p>Counting under bag semantics. So far, we have only considered counting under set semantics. However, by a slight change of the initialisation step, the algorithm presented in Section 3 works for counting under bag semantics as well. Further, note that the proof of Theorem 4 heavily depends on assuming set semantics for the query. In fact, we can show the following result.</p><p>Theorem 7. Suppose that we only consider ACQs. Then, for query Q with join tree T over schema R and instance I, #CQ w.r.t. bag semantics can be solved in time O(|Q| • max t∈T |R t | 2 ) (assuming unit cost for arithmetic operations), no matter whether Q contains nondistinguished variables or not. Proof (sketch). First, note that under bag semantics, there is no need to make a distinction between distinguished-and nondistinguished variables: In Section 4, the problem was to avoid multiple counting of the same solution if it can be derived in several ways. However, under bag semantics, this is exactly what we want to do. Hence, we can just consider all variables in Q as free.</p><p>It therefore remains to show that the algorithm from Section 3 can be adapted to bag semantics. In fact, the only thing that needs to be changed is in the initialisation phase: Recall that for every distinct tuple ρ ∈ R t , we add a tuple (ρ, 1) to Rt . All that needs to be changed is to replace 1 by the number of occurrences of ρ ∈ R t . It can be easily checked that the remaining algorithm can be left unchanged.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Conclusion</head><p>In <ref type="bibr" target="#b15">[16]</ref>, we started to look for a tractable fragment of the #CQ problem via the tree-width of the query. In the current paper, we initiated a systematic study of tractable fragments of #CQ, considering ACQs and CQs with bounded hypertree-width (which is a more general measure than tree-width). We have presented new algorithms based on semi-joins which allowed us to prove several new tractability results. We also identified limits to this search for tractable fragments by proving the #P-completeness of the #CQ problem for arbitrary acyclic conjunctive queries. Our results apply to the count operator, which is an integral part of the SQL language. In the future, we want to extend the search for tractable fragments to other aggregate functions (like minimum, maximum, sum, average) and to the group by construct in SQL.</p><p>Another interesting extension of <ref type="bibr" target="#b15">[16]</ref> would be the search for a dichotomy result in the style of <ref type="bibr" target="#b12">[13]</ref>. Further, extending the results from <ref type="bibr" target="#b1">[2]</ref> concerning the expressiveness of counting the answers of CQs to ACQs, and addressing the complexity related questions raised there is another direction for future work.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head></head><label></label><figDesc>By the disjointness of N (T r , r, α) for different values of α, | α∈Rr N (T r , r, α)| = α∈Rr |N (T r , r, α)|, and therefore α∈Rr c α gives the number of different solutions. It remains to show how to compute the values for each Rt . The algorithm for this consists of two phases: The initialisation phase, and a bottom-up traversal of the tree.</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Theorem 2 .</head><label>2</label><figDesc>Suppose that we only consider ACQs Q : ans(x) ← ∃yφ(x, y) with nondistinguished variables y. Then for query Q over schema R and instance I, #CQ can be solved in time O(|dom(I)| |x| • |Q| • |I|).</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Fig. 2 .Theorem 3 .</head><label>23</label><figDesc>Fig. 2. Annotated join tree for the query Q (Example 2) over I.</figDesc></figure>
		</body>
		<back>

			<div type="funding">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>This work was supported by the Vienna Science and Technology Fund (WWTF), project ICT08-032.</p></div>
			</div>

			<div type="annex">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>perfect matching for a bipartite graph G = (V, E) is a subset M ⊆ E s.t. every v ∈ V is contained in exactly one e ∈ M . Let an arbitrary instance of #PERFECT MATCHINGS be given by a bipartite graph G = (V, E), where V = A ∪ B with A = {a 1 , . . . , a n }, B = {b 1 , . . . , b n }, and E ⊆ A × B. From this, we create a database instance I over the schema S = {e/2, t/2} as follows:</p><p>where, by slight abuse of notation, we use a i and b i to denote both, vertices in V and constants in I. We further define two conjunctive queries</p><p>Note that a perfect matching is equivalent to a bijective mapping from A to B along the edges in E. The idea of the reduction is that Q 1 (over I) selects all possible mappings of nodes from A to nodes from B, while Q 2 selects all those mappings where at least one element from B is not assigned to an element from A. Hence, Q 1 (I)\Q 2 (I) gives exactly the set of perfect matchings, and because of</p><p>| returns the number of perfect matchings. Note that this is a special case of a Turing reduction, called subtractive reduction <ref type="bibr" target="#b5">[6]</ref>.</p><p>Obviously, this reduction is feasible in polynomial time. Its correctness as well as the membership will be proved in the full version.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Extensions</head><p>In this section we discuss some extensions and applications of our main results.</p><p>Unions of conjunctive queries. For unions of conjunctive queries (UCQs), it is well known that the decision problem is not harder to solve than for CQs. In contrast, for the counting problem, even if we consider UCQs with distinguished variables only, we encounter a similar problem as for CQs with nondistinguished variables: the same answer could be produced in different ways. For UCQs this means that the same answer could appear in several disjuncts. In fact, a slight modification of the proof of Theorem 4 yields the following intractability result.</p><p>Theorem 5. Suppose that we only consider unions of acyclic conjunctive queries ans(x) ← n i=1 φ i (x) without nondistinguished variables. Then the combined complexity of the counting problem of such UCQs is #P-complete.</p><p>Proof (idea). For the hardness, recall the hardness part of the proof of Theorem 4. We use the same reduction as described there, only that instead of a single relation t/2, we use n relations t i /1, and we define Q 2 as Q 2 : ans(x 1 , . . . , x n ) ← n j=1 n i=1 e(a i , x i ) ∧ n i=1 t j (x i ) . We define instance I also as before, but instead of the content of t, we have</p><p>Intuitively, we expand the query by instantiating the existentially quantified variable in Q 2 , and create one disjunct for every instantiation. Hence, for the correctness, analogous arguments as in the proof of Theorem 4 apply.</p><p>Queries with bounded hypertree-width. In <ref type="bibr" target="#b10">[11]</ref> it was shown that testing if the result of a CQ is nonempty (or whether the result contains a certain tuple) is tractable for queries with bounded hypertree-width. Below we also generalise the tractability of #CQ on ACQs to queries with bounded hypertree-width.</p></div>			</div>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">An algebraic approach to the complexity of generalized conjunctive queries</title>
		<author>
			<persName><forename type="first">M</forename><surname>Bauland</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Chapdelaine</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Creignou</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Hermann</surname></persName>
		</author>
		<author>
			<persName><forename type="first">H</forename><surname>Vollmer</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">SAT 2004 -Revised Selected Papers</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2005">2005</date>
			<biblScope unit="volume">3542</biblScope>
			<biblScope unit="page" from="30" to="45" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">Database interrogation using conjunctive queries</title>
		<author>
			<persName><forename type="first">M</forename><surname>Bielecki</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">V</forename><surname>Den Bussche</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proc. ICDT 2003</title>
				<meeting>ICDT 2003</meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2003">2003</date>
			<biblScope unit="page" from="259" to="269" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">Optimal implementation of conjunctive queries in relational data bases</title>
		<author>
			<persName><forename type="first">A</forename><forename type="middle">K</forename><surname>Chandra</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">M</forename><surname>Merlin</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proc. STOC 1977</title>
				<meeting>STOC 1977</meeting>
		<imprint>
			<publisher>ACM</publisher>
			<date type="published" when="1977">1977</date>
			<biblScope unit="page" from="77" to="90" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Conjunctive query containment revisited</title>
		<author>
			<persName><forename type="first">C</forename><surname>Chekuri</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Rajaraman</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Theor. Comput. Sci</title>
		<imprint>
			<biblScope unit="volume">239</biblScope>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="211" to="229" />
			<date type="published" when="2000">2000</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">Complexity of generalized satisfiability counting problems</title>
		<author>
			<persName><forename type="first">N</forename><surname>Creignou</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Hermann</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Inf. Comput</title>
		<imprint>
			<biblScope unit="volume">125</biblScope>
			<biblScope unit="issue">1</biblScope>
			<biblScope unit="page" from="1" to="12" />
			<date type="published" when="1996">1996</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">Subtractive reductions and complete problems for counting complexity classes</title>
		<author>
			<persName><forename type="first">A</forename><surname>Durand</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Hermann</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">G</forename><surname>Kolaitis</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Theor. Comput. Sci</title>
		<imprint>
			<biblScope unit="volume">340</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="496" to="513" />
			<date type="published" when="2005">2005</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">Degrees of acyclicity for hypergraphs and relational database schemes</title>
		<author>
			<persName><forename type="first">R</forename><surname>Fagin</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">J. ACM</title>
		<imprint>
			<biblScope unit="volume">30</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="514" to="550" />
			<date type="published" when="1983">1983</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">Query evaluation via tree-decompositions</title>
		<author>
			<persName><forename type="first">J</forename><surname>Flum</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Frick</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Grohe</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">J. ACM</title>
		<imprint>
			<biblScope unit="volume">49</biblScope>
			<biblScope unit="issue">6</biblScope>
			<biblScope unit="page" from="716" to="752" />
			<date type="published" when="2002">2002</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">A comparison of structural CSP decomposition methods</title>
		<author>
			<persName><forename type="first">G</forename><surname>Gottlob</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Leone</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Scarcello</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Artif. Intell</title>
		<imprint>
			<biblScope unit="volume">124</biblScope>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="243" to="282" />
			<date type="published" when="2000">2000</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">The complexity of acyclic conjunctive queries</title>
		<author>
			<persName><forename type="first">G</forename><surname>Gottlob</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Leone</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Scarcello</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">J. ACM</title>
		<imprint>
			<biblScope unit="volume">48</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="431" to="498" />
			<date type="published" when="2001">2001</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">Hypertree decompositions and tractable queries</title>
		<author>
			<persName><forename type="first">G</forename><surname>Gottlob</surname></persName>
		</author>
		<author>
			<persName><forename type="first">N</forename><surname>Leone</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Scarcello</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">J. Comput. Syst. Sci</title>
		<imprint>
			<biblScope unit="volume">64</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="579" to="627" />
			<date type="published" when="2002">2002</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<monogr>
		<title level="m" type="main">On the universal relation</title>
		<author>
			<persName><forename type="first">M</forename><surname>Graham</surname></persName>
		</author>
		<imprint>
			<date type="published" when="1979">1979</date>
		</imprint>
		<respStmt>
			<orgName>University of Toronto technical report</orgName>
		</respStmt>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<analytic>
		<title level="a" type="main">When is the evaluation of conjunctive queries tractable?</title>
		<author>
			<persName><forename type="first">M</forename><surname>Grohe</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Schwentick</surname></persName>
		</author>
		<author>
			<persName><forename type="first">L</forename><surname>Segoufin</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proc. STOC 2001</title>
				<meeting>STOC 2001</meeting>
		<imprint>
			<date type="published" when="2001">2001</date>
			<biblScope unit="page" from="657" to="666" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<analytic>
		<title level="a" type="main">Conjunctive-query containment and constraint satisfaction</title>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">G</forename><surname>Kolaitis</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><forename type="middle">Y</forename><surname>Vardi</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">J. Comput. Syst. Sci</title>
		<imprint>
			<biblScope unit="volume">61</biblScope>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="302" to="332" />
			<date type="published" when="2000">2000</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b14">
	<monogr>
		<title level="m" type="main">Computational complexity</title>
		<author>
			<persName><forename type="first">C</forename><forename type="middle">H</forename><surname>Papadimitriou</surname></persName>
		</author>
		<imprint>
			<date type="published" when="1994">1994</date>
			<publisher>Addison-Wesley</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b15">
	<analytic>
		<title level="a" type="main">The complexity of evaluating tuple generating dependencies</title>
		<author>
			<persName><forename type="first">R</forename><surname>Pichler</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Skritek</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proc. ICDT 2011</title>
				<meeting>ICDT 2011</meeting>
		<imprint>
			<publisher>ACM</publisher>
			<date type="published" when="2011">2011</date>
			<biblScope unit="page" from="244" to="255" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b16">
	<analytic>
		<title level="a" type="main">Graph minors. ii. algorithmic aspects of treewidth</title>
		<author>
			<persName><forename type="first">N</forename><surname>Robertson</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">D</forename><surname>Seymour</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">J. Algorithms</title>
		<imprint>
			<biblScope unit="volume">7</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="309" to="322" />
			<date type="published" when="1986">1986</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b17">
	<analytic>
		<title level="a" type="main">The complexity of enumeration and reliability problems</title>
		<author>
			<persName><forename type="first">L</forename><forename type="middle">G</forename><surname>Valiant</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">SIAM J. Comput</title>
		<imprint>
			<biblScope unit="volume">8</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="410" to="421" />
			<date type="published" when="1979">1979</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b18">
	<analytic>
		<title level="a" type="main">Algorithms for acyclic database schemes</title>
		<author>
			<persName><forename type="first">M</forename><surname>Yannakakis</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proc. VLDB 1981</title>
				<meeting>VLDB 1981</meeting>
		<imprint>
			<publisher>IEEE Computer Society</publisher>
			<date type="published" when="1981">1981</date>
			<biblScope unit="page" from="82" to="94" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b19">
	<analytic>
		<title level="a" type="main">An algorithm for tree-query membership of a distributed query</title>
		<author>
			<persName><forename type="first">C</forename><surname>Yu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Ozsoyoglu</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proc. COMPSAC 1979w</title>
				<meeting>COMPSAC 1979w</meeting>
		<imprint>
			<publisher>IEEE</publisher>
			<date type="published" when="1979">1979</date>
			<biblScope unit="page" from="306" to="312" />
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
