Abstract
This paper investigates the computational complexity of determining expected multiplicities in probabilistic databases under bag semantics. We specifically focus on the $c$-TIDB model, where tuple multiplicities are independent random variables bounded by a constant $c$. While exact computation of expected multiplicities is shown to be super-linear relative to deterministic query evaluation—linked to hard problems like Triangle Detection—we present a novel sampling-based approximation algorithm. This algorithm achieves a $(1 \pm \epsilon)$-approximation in linear time, effectively bridging the performance gap between probabilistic and deterministic query processing for bag semantics.
Introduction
Probabilistic Databases (PDBs) have traditionally focused on set semantics, determining the marginal probability of a tuple's existence. However, real-world database systems (e.g., SQL engines) utilize bag semantics, where the number of occurrences (multiplicity) of a tuple is critical for operations like summation and averaging. This work addresses the challenge of computing expected multiplicities in $c$-TIDBs, where each input tuple's multiplicity is an independent random variable bounded by a constant $c$. We explore whether these expectations can be computed as efficiently as standard deterministic queries.
Methods and Lineage Representation
The derivation of result tuples is represented using lineage polynomials, compactly encoded as arithmetic circuits—directed acyclic graphs of sums and products. Figure 1 illustrates the workflow from the probabilistic database $\mathcal{D}$ to the construction of lineage circuits (LC) and the subsequent computation of expected multiplicities (EC).
To compute the expectation $\mathbb{E}[\Phi(X)]$, the authors utilize a "reduced polynomial" approach, simplifying exponents and removing dependent terms within the lineage circuit. Because exact reduction is computationally expensive, a sampling algorithm is employed. This algorithm traverses the circuit to sample monomials with probability proportional to their weights, allowing for efficient estimation of the total expectation without full polynomial expansion.
Hardness and Complexity
Using fine-grained complexity analysis, we demonstrate that exact computation of expected multiplicities is likely impossible in linear time. The problem is linked to well-known hard problems such as Triangle Detection and the Exponential Time Hypothesis (ETH). For certain query families, exact computation requires $\Omega(n^{1+\epsilon})$ time, indicating a significant overhead compared to deterministic processing.
Key Results and Practicality
Experimental evaluation using TPC-H and PDBench benchmarks confirms the efficiency of the approximation algorithm. A key insight is that the parameter $\gamma$, which measures term cancellations due to dependencies, is remarkably low in practice (often $0\%$ to $0.1\%$). Consequently, the sampling algorithm scales linearly with the size of the lineage circuit, matching the complexity of deterministic query evaluation ($O(T_{det})$). This demonstrates that while exact counts are hard, high-quality approximations are practical for massive datasets.
Conclusion
This study characterizes the complexity of bag semantics in PDBs, identifying fundamental hardness barriers for exact computation while providing a scalable linear-time approximation for $RA^+$ queries. Future work will extend these techniques to handle negation, unbounded multiplicities, and higher statistical moments such as variance.
Summary updated