Fixpoint Semantics and Optimization of Recursive Datalog Programs with Aggregates
Carlo Zaniolo, Mohan Yang, Matteo Interlandi, Ariyam Das, Alexander Shkapsky, Tyson Condie
备注:
Paper presented at the 33nd International Conference on Logic Programming (ICLP 2017), Melbourne, Australia, August 28 to September 1, 2017. 16 pages, LaTeX (arXiv:1707.05681)
在过去的三十年里,许多研究人员研究了一个非常理想的数据库扩展,它允许在递归规则中使用基本的SQL聚合min,max,count和sum。在本文中,我们提出了一个简单的全面的解决方案,扩展了声明性的最小不动点的Horn子句的语义,以及优化技术中使用的自下而上的实现方法,通过许多数据库系统。首先,我们确定了一个大类的程序的极大的实际利益,在递归规则中使用最小或最大值不妥协的声明性不动点语义的程序使用这些规则。然后,我们重新审视了(Mazuran et al. 2013 b)中提出的count和sum聚合的单调版本,并分别命名为mcount和msum。由于mcount以及正数上的msum在集合包含格中是单调的,它们保持Horn子句的不动点语义。然而,在许多实际应用中,它们的使用可能导致效率低下,这可以通过将它们与max组合来消除,从而mcount和msum成为标准的count和sum。因此,Datalog-MC的语义和优化技术被扩展到具有min,max,count和sum的递归程序,使得BigDatalog-MC(Shkapsky et al. 2016)和Datalog-MC(Yang et al. 2017)所展示的卓越性能和可扩展性的高级应用成为可能。本文件正在考虑被TPLP接受。
英文摘要:
A very desirable Datalog extension investigated by many researchers in the last thirty years consists in allowing the use of the basic SQL aggregates min, max, count and sum in recursive rules. In this paper, we propose a simple comprehensive solution that extends the declarative least-fixpoint semantics of Horn Clauses, along with the optimization techniques used in the bottom-up implementation approach adopted by many Datalog systems. We start by identifying a large class of programs of great practical interest in which the use of min or max in recursive rules does not compromise the declarative fixpoint semantics of the programs using those rules. Then, we revisit the monotonic versions of count and sum aggregates proposed in (Mazuran et al. 2013b) and named, respectively, mcount and msum. Since mcount, and also msum on positive numbers, are monotonic in the lattice of set-containment, they preserve the fixpoint semantics of Horn Clauses. However, in many applications of practical interest, their use can lead to inefficiencies, that can be eliminated by combining them with max, whereby mcount and msum become the standard count and sum. Therefore, the semantics and optimization techniques of Datalog are extended to recursive programs with min, max, count and sum, making possible the advanced applications of superior performance and scalability demonstrated by BigDatalog (Shkapsky et al. 2016) and Datalog-MC (Yang et al. 2017). This paper is under consideration for acceptance in TPLP.
Fixing the Fixpoint: A Formal Theory of Convergence Detection for Incremental Recursive Computation
University of California, Berkeley(加州大学伯克利分校);Shanghai Jiao Tong University(上海交通大学);UW-Madison(威斯康星大学麦迪逊分校);University of Wisconsin–Madison(威斯康星大学麦迪逊分校);Google DeepMind(谷歌DeepMind)
Multiset semantics in SPARQL, Relational Algebra and Datalog
Universidad de Talca(塔尔卡大学);Millenium Institute for Foundational Research on Data (IMFD)(数据基础研究千年研究所);Universidad de Chile(智利大学);University of Stuttgart(斯图加特大学)
University of Bamberg(班贝格大学);Leipzig University(莱比锡大学);ScaDS.AI Center Dresden/Leipzig(德累斯顿/莱比锡可扩展数据分析与人工智能中心);LIRMM(法国朗格多克信息、机器人与微电子实验室);Inria(法国国家信息与自动化研究所);University of Montpellier(蒙彼利埃大学);CNRS(法国国家科学研究中心);University of Warsaw(华沙大学)
TU Wien(维也纳工业大学);Univ. Lille(里尔大学);Birkbeck, University of London(伦敦大学伯贝克学院);University of Oviedo(奥维耶多大学);University of Bayreuth(拜罗伊特大学);Universita di Napoli Federico II(那不勒斯费德里科二世大学);University of Warsaw(华沙大学);Paderborn University(帕德博恩大学);Free University of Bolzano(波尔扎诺自由大学);University of Białystok(比亚韦斯托克大学)