PANDA is a powerful generic algorithm for answering conjunctive queries (CQs) and disjunctive datalog rules (DDRs) given input degree constraints. In the special case where degree constraints are cardinality constraints and the query is Boolean, PANDA runs in $\tilde O (N^{subw})$-time, where $N$ is the input size, and $subw$ is the submodular width of the query, a notion introduced by Daniel Marx (JACM 2013). When specialized to certain classes of sub-graph pattern finding problems, the $\tilde O(N^{subw})$ runtime matches the optimal runtime possible, modulo some conjectures in fine-grained complexity (Bringmann and Gorbachev (STOC 25)). The PANDA framework is much more general, as it handles arbitrary input degree constraints, which capture common statistics and integrity constraints used in relational database management systems, it works for queries with free variables, and for both CQs and DDRs. The key weakness of PANDA is the large $polylog(N)$-factor hidden in the $\tilde O(\cdot)$ notation. This makes PANDA completely impractical, and fall short of what is achievable with specialized algorithms. This paper resolves this weakness with two novel ideas. First, we prove a new probabilistic inequality that upper-bounds the output size of DDRs under arbitrary degree constraints. Second, the proof of this inequality directly leads to a new algorithm named PANDAExpress that is both simpler and faster than PANDA. The novel feature of PANDAExpress is a new partitioning scheme that uses arbitrary hyperplane cuts instead of axis-parallel hyperplanes used in PANDA. These hyperplanes are dynamically constructed based on data-skewness statistics carefully tracked throughout the algorithm's execution. As a result, PANDAExpress removes the $polylog(N)$-factor from the runtime of PANDA, matching the runtimes of intricate specialized algorithms, while retaining all its generality and power.
翻译:PANDA是一种强大的通用算法,用于在给定输入度约束条件下回答合取查询(CQs)和析取数据日志规则(DDRs)。在度约束为基数约束且查询为布尔型的特殊情况下,PANDA的运行时间为$\tilde O (N^{subw})$,其中$N$为输入规模,$subw$为查询的子模宽度,该概念由Daniel Marx(JACM 2013)提出。当应用于特定类别的子图模式查找问题时,$\tilde O(N^{subw})$的运行时间在精细粒度复杂性(Bringmann和Gorbachev(STOC 25))的某些猜想下达到了可能的最优运行时间。PANDA框架具有更广泛的通用性,能够处理任意输入度约束(这些约束捕获了关系数据库管理系统中常用的统计量和完整性约束),适用于含自由变量的查询,并同时支持CQs和DDRs。PANDA的关键弱点在于$\tilde O(\cdot)$符号中隐藏的巨大$polylog(N)$因子,这导致PANDA完全不具备实用性,且无法达到专用算法所能实现的性能。本文通过两个创新性思路解决了这一弱点。首先,我们证明了一个新的概率不等式,该不等式在任意度约束下为DDRs的输出规模提供了上界。其次,该不等式的证明直接导出了一个名为PANDAExpress的新算法,该算法比PANDA更简洁、更快速。PANDAExpress的创新特性在于采用了一种新的划分方案,该方案使用任意超平面切割替代了PANDA中使用的轴平行超平面。这些超平面基于算法执行过程中精心跟踪的数据偏斜统计量动态构建。因此,PANDAExpress消除了PANDA运行时间中的$polylog(N)$因子,在保持其全部通用性和强大功能的同时,达到了复杂专用算法的运行时间水平。