Computing Data Distribution from Query Selectivities

Abstract

We are given a set Z=\(R1,s1),…, (Rn,sn)\, where each Ri is a range in d, such as rectangle or ball, and si ∈ [0,1] denotes its selectivity. The goal is to compute a small-size discrete data distribution D=\(q1,w1),…, (qm,wm)\, where qj∈ d and wj∈ [0,1] for each 1≤ j≤ m, and Σ1≤ j≤ mwj= 1, such that D is the most consistent with Z, i.e., errp(D,Z)=1nΣi=1n\! si-Σj=1m wj· 1(qj∈ Ri)p is minimized. In a database setting, Z corresponds to a workload of range queries over some table, together with their observed selectivities (i.e., fraction of tuples returned), and D 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)δ-2polylog), a discrete distribution D of size O(δ-2), such that errp(D,Z)≤ Derrp(D,Z)+δ (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.

0

Turn this paper into a lesson

ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.

Discussion (0)

Sign in to join the discussion.

Loading comments…