连接查询上分位数的高效计算
Efficient Computation of Quantiles over Joins
AI总结:
本文研究连接查询上分位数查询的高效计算,提出基于枢轴答案选择和答案空间划分的新方法,证明了 min 和 max 对无环连接查询的易处理性,并将 sum 的二分性扩展到部分和,同时给出难解情形的确定性近似方案。
摘要:
我们提出了用于分位数连接查询(Quantile Join Queries,缩写为 %JQ)的高效算法。%JQ 要求在连接查询(Join Query,JQ)答案的某种排序下,返回指定相对位置(例如 50% 对应中位数)处的答案。我们的目标是避免物化所有连接答案的集合,并在数据库规模上实现拟线性时间,而不管答案总数有多少。最近的一个二分性结果排除了对一般查询和排序族存在此类算法的可能性。具体而言,对于无自连接的无环 JQ,当我们连接两个以上关系(且这些连接不是平凡交集)时,按 sum 排序会使问题变得难解。此外,即使对于超出 sum 的基本排序函数,例如不同属性上的 min 或 max,迄今为止仍不清楚是否存在任何非平凡的易处理 %JQ。在本工作中,我们开发了一种求解 %JQ 的新方法。我们的解决方案使用两个子例程:第一个需要选择我们称之为“枢轴答案”的对象。第二个子例程根据该枢轴划分查询答案空间,并继续在其中一个划分中搜索,该划分被表示为新数据库上的新 %JQ。对于枢轴选择,我们开发了一种算法,适用于一大类具有适当单调性的排序函数。第二个子例程需要针对手头的具体排序函数进行定制化构造。我们通过使用该方法建立若干新的复杂性结果来展示其优势和通用性。首先,我们证明了 min 和 max 对所有无环 JQ 的易处理性,从而解决了上述问题。其次,我们将先前关于 sum 的 %JQ 二分性扩展到所有部分和。第三,我们通过设计一个适用于每个无环 JQ 的确定性近似方案来处理 sum 的难解情形。
英文摘要:
We present efficient algorithms for Quantile Join Queries, abbreviated as %JQ. A %JQ asks for the answer at a specified relative position (e.g., 50% for the median) under some ordering over the answers to a Join Query (JQ). Our goal is to avoid materializing the set of all join answers, and to achieve quasilinear time in the size of the database, regardless of the total number of answers. A recent dichotomy result rules out the existence of such an algorithm for a general family of queries and orders. Specifically, for acyclic JQs without self-joins, the problem becomes intractable for ordering by sum whenever we join more than two relations (and these joins are not trivial intersections). Moreover, even for basic ranking functions beyond sum, such as min or max over different attributes, so far it is not known whether there is any nontrivial tractable %JQ. In this work, we develop a new approach to solving %JQ. Our solution uses two subroutines: The first one needs to select what we call a "pivot answer". The second subroutine partitions the space of query answers according to this pivot, and continues searching in one partition that is represented as new %JQ over a new database. For pivot selection, we develop an algorithm that works for a large class of ranking functions that are appropriately monotone. The second subroutine requires a customized construction for the specific ranking function at hand. We show the benefit and generality of our approach by using it to establish several new complexity results. First, we prove the tractability of min and max for all acyclic JQs, thereby resolving the above question. Second, we extend the previous %JQ dichotomy for sum to all partial sums. Third, we handle the intractable cases of sum by devising a deterministic approximation scheme that applies to every acyclic JQ.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。