Rewriting queries with arbitrary aggregation functions using views

Sara Cohen*, Werner Nutt, Yehoshua Sagiv

*Corresponding author for this work

Research output: Contribution to journalReview articlepeer-review

32 Scopus citations


The problem of rewriting aggregate queries using views is studied for conjunctive queries with arbitrary aggregation functions and built-in predicates. Two types of queries over views are introduced for rewriting aggregate queries: pure candidates and aggregate candidates. Pure candidates can be used to rewrite arbitrary aggregate queries. Aggregate candidates can be used to rewrite queries containing aggregate functions definable in terms of a commutative-semigroup operation. For both types of candidates (as well as for several relaxations of these candidates), the unfolding property holds. This allows characterizations for query equivalence to be used to determine whether a candidate is a rewriting of a query. The complexity of the rewriting-existence problem is also studied and upper and lower complexity bounds are given.

Original languageAmerican English
Pages (from-to)672-715
Number of pages44
JournalACM Transactions on Database Systems
Issue number2
StatePublished - 2006
Externally publishedYes


  • Query equivalence
  • Query rewriting
  • View usability


Dive into the research topics of 'Rewriting queries with arbitrary aggregation functions using views'. Together they form a unique fingerprint.

Cite this