TY - JOUR

T1 - Equivalences among aggregate queries with negation

AU - Cohen, Sara

AU - Sagiv, Yehoshua

AU - Nutt, Werner

PY - 2005/4

Y1 - 2005/4

N2 - Query equivalence is investigated for disjunctive aggregate queries with negated subgoals, constants and comparisons. A full characterization of equivalence is given for the aggregation functions count, max, sum, prod, top2 and parity. A related problem is that of determining, for a given natural number N, whether two given queries are equivalent over all databases with at most N constants. This problem is called bounded equivalence. A complete characterization of decidability of bounded equivalence is given. In particular, it is shown that this problem is decidable for all the above aggregation functions as well as for cntd (count distinct) and avg. For quasilinear queries (i.e., queries in which predicates that occur positively are not repeated), it is shown that equivalence can be decided in polynomial time for the aggregation functions count, max, sum, parity, prod, top2 and avg. A similar result holds for cntd provided that a few additional conditions hold. The results are couched in terms of abstract characteristics of aggregation functions, and new proof techniques are used. Finally, the results above also imply that equivalence, under bag-set semantics, is decidable for nonaggregate queries with negation.

AB - Query equivalence is investigated for disjunctive aggregate queries with negated subgoals, constants and comparisons. A full characterization of equivalence is given for the aggregation functions count, max, sum, prod, top2 and parity. A related problem is that of determining, for a given natural number N, whether two given queries are equivalent over all databases with at most N constants. This problem is called bounded equivalence. A complete characterization of decidability of bounded equivalence is given. In particular, it is shown that this problem is decidable for all the above aggregation functions as well as for cntd (count distinct) and avg. For quasilinear queries (i.e., queries in which predicates that occur positively are not repeated), it is shown that equivalence can be decided in polynomial time for the aggregation functions count, max, sum, parity, prod, top2 and avg. A similar result holds for cntd provided that a few additional conditions hold. The results are couched in terms of abstract characteristics of aggregation functions, and new proof techniques are used. Finally, the results above also imply that equivalence, under bag-set semantics, is decidable for nonaggregate queries with negation.

KW - Aggregation

KW - Datalog

KW - Negation

KW - Query equivalence

UR - http://www.scopus.com/inward/record.url?scp=16644396544&partnerID=8YFLogxK

U2 - 10.1145/1055686.1055691

DO - 10.1145/1055686.1055691

M3 - ???researchoutput.researchoutputtypes.contributiontojournal.article???

AN - SCOPUS:16644396544

SN - 1529-3785

VL - 6

SP - 328

EP - 360

JO - ACM Transactions on Computational Logic

JF - ACM Transactions on Computational Logic

IS - 2

ER -