Provenance of HAVING Queries in Semirings with Monus
This study addresses the limitation of the standard semiring framework in supporting data provenance for aggregation queries involving HAVING clauses. We propose defining, for the first time, a provenance semantics for such queries within commutative semirings with monus (m-semirings). This formulation inherently accommodates self-join rewriting standards without introducing additional operators, and we formally prove their equivalence. Furthermore, we implement algorithmic optimizations and a prototype system building upon ProvSQL. The primary contribution lies in overcoming the constraints of classical semiring theory regarding aggregation operations, thereby providing a unified and elegant provenance semantics framework for aggregate queries. Experimental evaluations on real-world datasets demonstrate that our approach effectively supports probabilistic query evaluation, confirming its practical viability and performance feasibility.