Abstract
Constraint satisfaction techniques, embedded in constraint programming languages such as CHIP, have proven their worth on a wide variety of practical applications. This paper describes a first step towards integrating these techniques into database systems. The main idea is to optimise complex queries by continually checking to see if the current partial results are consistent with the remainder of the query.
In this paper we present a query language, based on Datalog, which enables the database user to control the checking by annotating certain atomic goals. We show how queries expressed in this language can be translated into queries expressed in standard Datalog. Each Datalog rule is separately optimised by the database optimiser.
The language and the translation are motivated by various examples; in particular an application to crossword generation is described where the optimisation proposed in this paper adds significantly to standard database optimisation techniques.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
P. Bernstein and D. Chiu. Using semi-joins to solve relational queries. ACM, 28(1):25–40, January 1983.
P. Brisset, T. Frühwirth, P. Lim, M. Meier, T. Le Provost, J. Schimpf, and M.G. Wallace. ECLiPSe 3.5 extension user manual. CHIC Deliverable D.6.2.4, ECRC, Arabellastr 17, Munich, Germany, 1995.
C. Beeri, R. Fagin, D. Maier, and M. Yannakakis. On the desirability of acyclic database schemes. ACM, 30(3):479–513, July 1983.
S. Bressan, T. Le Provost, and M.G. Wallace. Towards the application of generalised propagation to database query processing. CHIC Deliverable D.5.2.3.5, ECRC, Arabellastr 17, Munich, Germany, 1994.
F. Bancilhon, D. Maier, Y. Sagiv, and J. Ullman. Magic sets and other strange ways to implement logic programs. In Proc. 5th ACM Symposium on Principles of Database Systems, 1986.
F. Bancilhon and R. Ramakrishnan. An amateur's introduction to recursive query processing. In Proc. SIGMOD, 1986. invited paper.
C. Beeri and R. Ramakrishnan. On the power of magic. In Proc. 6th PODS, 1987.
S. Bressan. Database query optimisation and evaluation as constraint satisfaction problem solving. In P. Revesz, D. Srivastava, P. Stuckey, and D. Sudarshan, editors, Proc. Post-ILPS Workshop on Constraints and Databases, Ithaca, NY., November 1994. Published as Technical Report UNL-CSE-94-025, Univ. of Nebraska.
C. Beeri, R. Ramakrishnan, D. Srivastava, and S Sudarshan. Magic implementation of stratified logic programs. Technical Report, August 1990.
U. S. Chakravarthy, J. Grant, and J. Minker. Foundations of semantic query optimization for deductive databases. In J. Minker, editor, Foundations of Deductive Databases and Logic Programming, pages 243–273. Morgan Kaufmann, 1988.
Rina Dechter. Constraint networks. In Stuart C. Shapiro, editor, Encyclopedia of Artificial Intelligence, pages 276–285. Wiley, 1992. Volume 1, second edition.
M. Dincbas, P. van Hentenryck, H. Simonis, A. Aggoun, T. Graf, and F. Berthier. The Constraint Logic Programming Language CHIP. In Proceedings of the International Conference on Fifth Generation Computer Systems FGCS-88, pages 693–702, Tokyo, Japan, December 1988.
ECRC. ECLiPSe knowledge base user manual. Technical report, ECRC, Arabellastr 17, 81925 Munich, 1993.
S.W. Golomb and L.D. Baumert. Backtrack programming. Journal of the ACM, 12:516–524, 1965.
M. Hammer and S. Zdonik. Knowledge-based query processing. In Proc. 6th VLDB Conference, Montreal, 1980.
ICL, Lloyd's Register, Imperial College, and UMIST. CHRONOS DTI/EPSRC project no. 8028. UK government funded Scientific Research Project, 1994.
ILOG. ILOG solver users manual. Technical report, ILOG, 1995.
J.J. King. Quist: A system for semantic query optimisation in relational databases. In Proc. 7th VLDB Conference, 1981.
Vipin Kumar. Algorithms for constraint-satisfaction problems: A survey. A.I. Magazine, 13(1):32–44, Spring 1992.
A.K. Mackworth. Consistency in networks of relations. Artificial Intelligence, 8(1):99–118, 1977.
Meier M. and et. al. ECLiPSe 3.5. Technical Report ECRC/ECLIPSE, ECRC, Arabellastr 17, 81725 Munich, 1995.
R. Mohr and T.C. Henderson. Arc and path consistency revisited. Artificial Intelligence, 28:225–233, 1986.
U. Montanari. Networks of constraints: fundamental properties and applications to picture processing. Information Science, 7(2):95–132, 1974.
T. Le Provost and M.G. Wallace. Generalised constraint propagation over, the CLP scheme. Journal of Logic Programming, 16(3):319–360, July 1993.
R. Ramakrishnan. Magic templates: A spellbinding approach to logic programs. In Proc. International Conference on Logic Programming, Seattle, Washington, 1988.
J. Rohmer, R. Lescoeur, and J.-M. Kerisit. The alexander method: A technique for the processing of recursive axioms in deductive databases. New Generation Computing, 4(3), 1986.
D. Sacca and C. Zaniolo. The generalised counting method for recursive logical queries. In Proc. 1st International Conference on Database Theory, 1986.
J. D. Ullman. Principles of Database Systems. Pitman, second edition, 1982.
Pascal Van Hentenryck. Constraint Satisfaction in Logic Programming. Logic Programming Series. MIT Press, Cambridge, MA, 1989.
L. Vieille. Recursive query processing: The power of logic. Theoretical Computer Science, 69(1), December 1989.
M.G. Wallace, editor. Proc. Conf. on Practical Applications of Constraints Technology, Paris, 1995.
D.H.D. Warren. Efficient processing of interactive relational database queries expressed in logic. In Proc. 7th VLDB, Cannes, 1981.
M.G. Wallace and T. Le Provost. Propia — final implementation. CHIC Deliverable D.5.2.3.6, ECRC, Arabellastr 17, Munich, Germany, 1995.
E. Wong and K. Youseffi. Decomposition — a strategy for query processing. ACM Transactions on Database Systems, 1(3):223–241, 1976.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Wallace, M., Bressan, S., Le Provost, T. (1996). Magic checking: Constraint checking for database query optimisation. In: Kuper, G., Wallace, M. (eds) Constraint Databases and Application. CDB 1995. Lecture Notes in Computer Science, vol 1034. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-60794-3_19
Download citation
DOI: https://doi.org/10.1007/3-540-60794-3_19
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-60794-6
Online ISBN: 978-3-540-49456-0
eBook Packages: Springer Book Archive