ACM Home Page
Please provide us with feedback. Feedback
Adding magic to an optimising datalog compiler
Full text PdfPdf (307 KB)
Source
International Conference on Management of Data archive
Proceedings of the 2008 ACM SIGMOD international conference on Management of data table of contents
Vancouver, Canada
SESSION: Research Session 12: Query Optimization table of contents
Pages 553-566  
Year of Publication: 2008
ISBN:978-1-60558-102-6
Authors
Damien Sereni  Semmle Ltd., Oxford, United Kingdom
Pavel Avgustinov  Semmle Ltd., Oxford, United Kingdom
Oege de Moor  Semmle Ltd., Oxford, United Kingdom
Sponsors
ACM: Association for Computing Machinery
SIGMOD: ACM Special Interest Group on Management of Data
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 18,   Downloads (12 Months): 169,   Citation Count: 0
Additional Information:

abstract   references   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1376616.1376673
What is a DOI?

ABSTRACT

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.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
 
2
François Bancilhon, David Maier, Yehoshua Sagiv, and Jeffrey D. Ullman. Magic sets and other strange ways to implement logic programs. In SIGMOD Conference, pages 1--16. ACM, 1986.
3
4
5
 
6
Oege de Moor, Damien Sereni, Mathieu Verbaere, Elnar Hajiyev, Pavel Avgustinov, Torbjörn Ekman, Neil Ongkingco, and Julian Tibble. .QL: Object-oriented queries made easy. In Generative and Transformational Techniques for Software Engineering (GTTSE '07), 2007.
 
7
Jack Edmonds. Optimum branchings. Journal of Research of the National Bureau of Standards -- B. Mathematics and Mathematical Physics, 71B(4):233--240, October-December 1967.
 
8
 
9
 
10
H2 Database Engine. Website with documentation and downloads. http://www.h2database.com, 2007.
 
11
Elnar Hajiyev, Mathieu Verbaere, and Oege de Moor. CodeQuest: scalable source code queries with Datalog. In Proceedings of ECOOP, volume 4067 of LNCS, pages 2--27. Springer, 2006.
 
12
Jakob Henriksson and Jan Małuszy\’nski. Static type-checking of datalog with ontologies. In Principles and Practice of Web Reasoning, volume 3208 of LNCS, pages 76--89, 2004.
 
13
JFreeChart. Website with documentation and downloads. http://www.jfree.org/jfreechart/, 2007.
 
14
15
 
16
 
17
Microsoft. SQL server website with documentation and downloads. http://www.microsoft.com/sql, 2007.
18
19
20
 
21
PostgreSQL. Documentation and downloads. http://www.postgresql.org, 2007.
 
22
 
23
Semmle Ltd. Collection of .QL queries used in benchmarks, 2007. http://semmle.com/benchmarks/defaultqueries.tar.gz.
 
24
Semmle Ltd. Company website with free downloads, documentation, and discussion forums. http://semmle.com, 2007.
 
25
Semmle Ltd. Database schema with annotations, 2007. http://semmle.com/benchmarks/semmlecode.dbscheme.
26
27
 
28
John Whaley, Dzintars Avots, Michael Carbin, and Monica S. Lam. Using datalog and binary decision diagrams for program analysis. In Proceedings of APLAS, volume 3780 of LNCS, pages 97--118. Springer, 2005.

Collaborative Colleagues:
Damien Sereni: colleagues
Pavel Avgustinov: colleagues
Oege de Moor: colleagues