PODS '87 Proceedings of the sixth ACM SIGACT-SIGMOD-SIGART symposium on Principles of database systems
Optimization of large join queries: combining heuristics and combinatorial techniques
SIGMOD '89 Proceedings of the 1989 ACM SIGMOD international conference on Management of data
Estimating the size of generalized transitive closures
VLDB '89 Proceedings of the 15th international conference on Very large data bases
SIGMOD '90 Proceedings of the 1990 ACM SIGMOD international conference on Management of data
Efficient bottom-up computation of queries on stratified databases
Journal of Logic Programming
Implementation of magic-sets in a relational database system
SIGMOD '94 Proceedings of the 1994 ACM SIGMOD international conference on Management of data
Cost-based optimization for magic: algebra and implementation
SIGMOD '96 Proceedings of the 1996 ACM SIGMOD international conference on Management of data
An algorithm for ordering subgoals in NAIL?
Proceedings of the seventh ACM SIGACT-SIGMOD-SIGART symposium on Principles of database systems
POPL '77 Proceedings of the 4th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
The VLDB Journal — The International Journal on Very Large Data Bases - Prototypes of deductive database systems
Optimization of Nonrecursive Queries
VLDB '86 Proceedings of the 12th International Conference on Very Large Data Bases
Arborescence optimization problems solvable by Edmonds' algorithm
Theoretical Computer Science
Context-sensitive program analysis as database queries
Proceedings of the twenty-fourth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems
Type inference for datalog and its application to query optimisation
Proceedings of the twenty-seventh ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems
Using datalog with binary decision diagrams for program analysis
APLAS'05 Proceedings of the Third Asian conference on Programming Languages and Systems
CodeQuest: scalable source code queries with datalog
ECOOP'06 Proceedings of the 20th European conference on Object-Oriented Programming
Deriving predicate statistics in datalog
Proceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming
More efficient datalog queries: subsumptive tabling beats magic sets
Proceedings of the 2011 ACM SIGMOD International Conference on Management of data
Optimizing inequality joins in datalog with approximated constraint propagation
PADL'12 Proceedings of the 14th international conference on Practical Aspects of Declarative Languages
Deriving predicate statistics for logic rules
RR'12 Proceedings of the 6th international conference on Web Reasoning and Rule Systems
Hi-index | 0.00 |
The magic-sets transformation is a useful technique for dramatically improving the performance of complex queries, but it has been observed that this transformation can also drastically reduce the performance of some queries. Successful implementations of magic in previous work require integration with the database optimiser to make appropriate decisions to guide the transformation (the sideways information passing strategy, or SIPS). This paper reports on the addition of the magic-sets transformation to a fully automatic optimising compiler from Datalog to SQL with no support from the database optimiser. We present an algorithm for making a good choice of SIPS using heuristics based on the sizes of relations. To achieve this, we define an abstract interpretation of Datalog programs to estimate the sizes of relations in the program. The effectiveness of our technique is evaluated over a substantial set of over a hundred queries, and in the context of the other optimisations performed by our compiler. It is shown that using the SIPS chosen by our algorithm, query performance is often significantly improved, as expected, but more importantly performance is never significantly degraded on queries that cannot benefit from magic.