View selection for real conjunctive queries

  • Authors:
  • Foto Afrati;Rada Chirkova;Manolis Gergatsoulis;Vassia Pavlaki

  • Affiliations:
  • National Technical University of Athens (NTUA), Department of Electrical and Computing Engineering, 15773, Athens, Greece;North Carolina State University, Computer Science Department, Campus Box 8206, 27695-8206, Raleigh, NC, USA;Ionian University, Department of Archive and Library Sciences, Campus Box 8206, Palea Anaktora, Plateia Eleftherias, 49100, Corfu, NC, Greece;National Technical University of Athens (NTUA), Department of Electrical and Computing Engineering, 15773, Athens, Greece

  • Venue:
  • Acta Informatica
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

Given a query workload, a database and a set of constraints, the view-selection problem is to select views to materialize so that the constraints are satisfied and the views can be used to compute the queries in the workload efficiently. A typical constraint, which we consider in the present work, is to require that the views can be stored in a given amount of disk space. Depending on features of SQL queries (e.g., the DISTINCT keyword) and on whether the database relations on which the queries are applied are sets or bags, the queries may be computed under set semantics, bag-set semantics, or bag semantics. In this paper we study the complexity of the view-selection problem for conjunctive queries and views under these semantics. We show that bag semantics is the “easiest to handle” (we show that in this case the decision version of view selection is in NP), whereas under set and bag-set semantics we assume further restrictions on the query workload (we only allow queries without self-joins in the workload) to achieve the same complexity. Moreover, while under bag and bag-set semantics filtering views (i.e., subgoals that can be dropped from the rewriting without impacting equivalence to the query) are practically not needed, under set semantics filtering views can reduce significantly the query-evaluation costs. We show that under set semantics the decision version of the view-selection problem remains in NP only if filtering views are not allowed in the rewritings. Finally, we investigate whether the cgalg algorithm for view selection introduced in Chirkova and Genesereth (Linearly bounded reformulations of conjunctive databases, pp. 987–1001, 2000) is suitable in our setting. We prove that this algorithm is sound for all cases we examine here, and that it is complete under bag semantics for workloads of arbitrary conjunctive queries and under bag-set semantics for workloads of conjunctive queries without self-joins.