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 2025)。PANDA框架更具通用性:它可处理任意输入度约束(涵盖关系数据库管理系统中常用的统计量和完整性约束),支持带自由变量的查询,并同时适用于CQs和DDRs。PANDA的关键缺陷在于$\tilde O(\cdot)$符号中隐藏的较大$polylog(N)$因子。这使得PANDA完全不可实际应用,且落后于专用算法所能达到的性能。本文通过两项创新解决了该缺陷。首先,我们证明了一个新的概率不等式,该不等式给出了任意度约束下DDRs输出规模的上界。其次,该不等式的证明直接引出了一项新算法PANDAExpress,它比PANDA更简单、更快速。PANDAExpress的新颖之处在于采用了一种基于任意超平面切割的划分方案,替代了PANDA中使用的轴平行超平面。这些超平面根据算法执行过程中精心跟踪的数据偏斜统计量动态构建。最终,PANDAExpress消除了PANDA运行时中的$polylog(N)$因子,在保留其所有通用性和强大能力的同时,匹配了复杂专用算法的运行时间。