arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.06047cs.DScs.DB
收藏

从查询选择率计算数据分布

Computing Data Distribution from Query Selectivities

Pankaj K. Agarwal, Rahul Raychaudhury, Stavros Sintos, Jun Yang

AI总结:

本文研究从范围查询选择率重构离散数据分布的问题,证明该问题NP完全,并提出一个Monte Carlo算法在加性误差δ内近似最优分布,同时给出条件性下界表明显著改进不太可能。

摘要:

给定一个集合 $\mathcal{Z}=\{(R_1,s_1),\ldots, (R_n,s_n)\}$,其中每个 $R_i$ 是 $\Re^d$ 中的一个范围(如矩形或球),$s_i \in [0,1]$ 表示其选择率。目标是计算一个小规模的离散数据分布 $\mathcal{D}=\{(q_1,w_1),\ldots, (q_m,w_m)\}$,其中对每个 $1\leq j\leq m$ 有 $q_j\in \Re^d$ 和 $w_j\in [0,1]$,且 $\sum_{1\leq j\leq m}w_j=1$,使得 $\mathcal{D}$ 与 $\mathcal{Z}$ 最一致,即最小化 $\mathrm{err}_p(\mathcal{D},\mathcal{Z})=\frac{1}{n}\sum_{i=1}^n\\! \lvert{s_i-\sum_{j=1}^m w_j\cdot 1(q_j\in R_i)}\rvert^p$。在数据库场景中,$\mathcal{Z}$ 对应于某张表上的一组范围查询工作负载及其观测到的选择率(即返回元组的比例),$\mathcal{D}$ 可作为紧凑模型,在不访问底层内容的情况下近似表内数据分布。本文针对该问题给出了上界和下界。特别地,我们证明了从选择率查询中寻找最佳数据分布的问题是 $\mathsf{NP}$ 完全的。在正面结果方面,我们描述了一个 Monte Carlo 算法,可在 $O((n+δ^{-d})δ^{-2}\mathop{\mathrm{polylog}})$ 时间内构造一个大小为 $O(δ^{-2})$ 的离散分布 $\tilde{\mathcal{D}}$,使得 $\mathrm{err}_p(\tilde{\mathcal{D}},\mathcal{Z})\leq \min_{\mathcal{D}}\mathrm{err}_p(\mathcal{D},\mathcal{Z})+δ$(对 $p=1,2,\infty$),其中最小值在所有离散分布上取得。我们还建立了条件性下界,强烈表明相对近似不可行,且加性近似中无法消除对维度的指数依赖。这意味着对我们的算法进行显著改进的可能性不大。

英文摘要:

We are given a set $\mathcal{Z}=\{(R_1,s_1),\ldots, (R_n,s_n)\}$, where each $R_i$ is a \emph{range} in $\Re^d$, such as rectangle or ball, and $s_i \in [0,1]$ denotes its \emph{selectivity}. The goal is to compute a small-size \emph{discrete data distribution} $\mathcal{D}=\{(q_1,w_1),\ldots, (q_m,w_m)\}$, where $q_j\in \Re^d$ and $w_j\in [0,1]$ for each $1\leq j\leq m$, and $\sum_{1\leq j\leq m}w_j= 1$, such that $\mathcal{D}$ is the most \emph{consistent} with $\mathcal{Z}$, i.e., $\mathrm{err}_p(\mathcal{D},\mathcal{Z})=\frac{1}{n}\sum_{i=1}^n\! \lvert{s_i-\sum_{j=1}^m w_j\cdot 1(q_j\in R_i)}\rvert^p$ is minimized. In a database setting, $\mathcal{Z}$ corresponds to a workload of range queries over some table, together with their observed selectivities (i.e., fraction of tuples returned), and $\mathcal{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 $\mathsf{NP}$-complete. On the positive side, we describe a Monte Carlo algorithm that constructs, in time $O((n+δ^{-d})δ^{-2}\mathop{\mathrm{polylog}})$, a discrete distribution $\tilde{\mathcal{D}}$ of size $O(δ^{-2})$, such that $\mathrm{err}_p(\tilde{\mathcal{D}},\mathcal{Z})\leq \min_{\mathcal{D}}\mathrm{err}_p(\mathcal{D},\mathcal{Z})+δ$ (for $p=1,2,\infty$) 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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑