Abstract
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.
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have
Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.