Datalog reasoning based on the semina\"ive evaluation strategy evaluates rules using traditional join plans, which often leads to redundancy and inefficiency in practice, especially when the rules are complex. Hypertree decompositions help identify efficient query plans and reduce similar redundancy in query answering. However, it is unclear how this can be applied to materialisation and incremental reasoning with recursive Datalog programs. Moreover, hypertree decompositions require additional data structures and thus introduce nonnegligible overhead in both runtime and memory consumption. In this paper, we provide algorithms that exploit hypertree decompositions for the materialisation and incremental evaluation of Datalog programs. Furthermore, we combine this approach with standard Datalog reasoning algorithms in a modular fashion so that the overhead caused by the decompositions is reduced. Our empirical evaluation shows that, when the program contains complex rules, the combined approach is usually significantly faster than the baseline approach, sometimes by orders of magnitude.
翻译:基于半朴素评估策略的Datalog推理采用传统连接计划来评估规则,这在实践中常导致冗余和低效,尤其在规则复杂时更为明显。超树分解有助于识别高效查询计划并减少查询回答中的类似冗余。然而,如何将其应用于递归Datalog程序的物化与增量推理尚不明确。此外,超树分解需要额外数据结构,从而在运行时和内存消耗方面引入不可忽视的开销。本文提出利用超树分解进行Datalog程序物化与增量评估的算法,并通过模块化方式将该方法与标准Datalog推理算法结合,以降低分解带来的开销。实验评估表明,当程序包含复杂规则时,该组合方法通常显著快于基线方法,有时甚至快数个数量级。