On the Expected Size of Recursive Datalog Queries

作者:

Highlights:

摘要

We present asymptotically exact expressions for the expected sizes of relations defined by three well-studied Datalog recursions, namely the "transitive closure," "same generation," and "canonical factorable recursion." We consider the size of the fixpoints of the recursively defined relations in the above programs, as well as the size of the fixpoints of the relations defined by the rewritten programs generated by the Magic Sets and Factoring rewriting algorithms in response to selection queries. Our results show that even over relatively sparse base relations, the fixpoints of the recursively defined relations are within a small constant factor of their worst-case size bounds, and that the Magic Sets rewriting algorithm on the average produces relations whose fixpoints are within a small constant factor of the corresponding bounds for the recursion without rewriting. The expected size of the fixpoint of the relations produced by the Factoring algorithm, when it applies, is significantly smaller than the expected size of the fixpoints of the relations produced by Magic Sets. This lends credence to the belief that reducing the arity of the recursive predicate is probably more important than restricting the recursion to relevant tuples.

论文关键词:

论文评审过程:Available online 25 May 2002.

论文官网地址:https://doi.org/10.1006/jcss.1995.1057