Computing Data Distribution from Query Selectivities

Published: 01 Jan 2024, Last Modified: 05 Aug 2024ICDT 2024EveryoneRevisionsBibTeXCC BY-SA 4.0
Abstract: We are given a set š’µ = {(R_1,s_1), …, (R_n,s_n)}, where each R_i is a range in ā„^d, such as rectangle or ball, and s_i ∈ [0,1] denotes its selectivity. The goal is to compute a small-size discrete data distribution š’Ÿ = {(q₁,w₁),…, (q_m,w_m)}, where q_j ∈ ā„^d and w_j ∈ [0,1] for each 1 ≤ j ≤ m, and āˆ‘_{1≤j≤m} w_j = 1, such that š’Ÿ is the most consistent with š’µ, i.e., err_p(š’Ÿ,š’µ) = 1/n āˆ‘_{i = 1}ⁿ |s_i - āˆ‘_{j=1}^m w_jā‹…1(q_j ∈ R_i)|^p is minimized. In a database setting, š’µ corresponds to a workload of range queries over some table, together with their observed selectivities (i.e., fraction of tuples returned), and š’Ÿ can be used as compact model for approximating the data distribution within the table without accessing the underlying contents. In this paper, we obtain both upper and lower bounds for this problem. In particular, we show that the problem of finding the best data distribution from selectivity queries is NP-complete. On the positive side, we describe a Monte Carlo algorithm that constructs, in time O((n+Ī“^{-d}) Ī“^{-2} polylog n), a discrete distribution š’ŸĢƒ of size O(Ī“^{-2}), such that err_p(š’ŸĢƒ,š’µ) ≤ min_š’Ÿ err_p(š’Ÿ,š’µ)+Ī“ (for p = 1,2,āˆž) where the minimum is taken over all discrete distributions. We also establish conditional lower bounds, which strongly indicate the infeasibility of relative approximations as well as removal of the exponential dependency on the dimension for additive approximations. This suggests that significant improvements to our algorithm are unlikely.
Loading