Magic sets and other strange ways to implement logic programs (extended abstract)
PODS '86 Proceedings of the fifth ACM SIGACT-SIGMOD symposium on Principles of database systems
Principles of database and knowledge-base systems, Vol. I
Principles of database and knowledge-base systems, Vol. I
Bottom-up beats top-down for datalog
PODS '89 Proceedings of the eighth ACM SIGACT-SIGMOD-SIGART symposium on Principles of database systems
On the power of Alexander templates
PODS '89 Proceedings of the eighth ACM SIGACT-SIGMOD-SIGART symposium on Principles of database systems
Is there anything better than magic
Proceedings of the 1990 North American conference on Logic programming
An analysis of magic sets and related optimization strategies for logic queries
Journal of the ACM (JACM)
Deductive Databases: Challenges, Opportunities and Future Directions (Panel Discussion)
LID '96 Proceedings of the International Workshop on Logic in Databases
Logic and Databases: A 20 Year Retrospective
LID '96 Proceedings of the International Workshop on Logic in Databases
Hi-index | 0.00 |
The magic-sets method is a basic query optimization method in the deductive database systems. However, the original magic-sets method may generate large magic predicates for recursive queries. In this case, the evaluation of the magic predicates dominate the whole evaluation cost. Factorized magic sets can limit the sizes of generated magic predicates by splitting some magic predicates. However, it suffers from a new "over-splitting" problem. In this paper, we focus on a problem: what is the best splitting schema for a magic predicate, given a magic program. We propose a hypergraph model to represent the magic program as well as its naive evaluation procedure. An intuition is a magic predicate whose arguments belong to different connected components in infinite number of its generated graphs is considered to be a big one. It thus should be split. Based on the hypergraph model, we propose a new concept, called c-partition, as the best splitting of a magic predicate. Although we still do not know how to construct a c-partition, we define a serial of d[k]-partitions to approximate the c-partition. We prove that d[k]-partition is better then the existing splitting algorithm. Our method is a global splitting strategy for magic predicates, in the sense that it decides whether or not to split a magic predicate by considering the whole program.