Skip to main content

SLDMagic — The Real Magic (With Applications to Web Queries)

  • Conference paper
  • First Online:
Computational Logic — CL 2000 (CL 2000)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 1861))

Included in the following conference series:

Abstract

The magic set technique is a standard technique for query evaluation in deductive databases, and its variants are also used in modern commercial database systems like DB2. Numerous improvements of the basic technique have been proposed. However, each of these optimizations makes the transformation more complicated, and combining them in a single system is at least difficult.

In this paper, a new transformation is introduced, which is based on partial evaluation of a bottom-up meta-interpreter for SLD-resolution. In spite of its simplicity, this technique gives us a whole bunch of optimizations for free: For instance, it contains a tail recursion optimization, it transforms non-recursive into non-recursive programs, it can pass arbitary conditions on the parameters to called predicates, and it saves the join necessary to get subquery results back into the calling context. In this way, it helps to integrate many of the previous efforts.

The usefulness of these optimizations is illustrated with example programs querying the World Wide Web.

This paper is a completely rewritten and significally extended version of a paper which appeared in the electronic proceedings of the International Workshop on “Advances in Databases and Information Systems”, Moscow, 1996.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. S. Abiteboul, P. Bunemann, D. Suciu (eds.): Data on the Web: From Relations to Semistructured Data and XML. Morgan Kaufmann, 2000.

    Google Scholar 

  2. S. Brass, J. Dix: Semantics of (disjunctive) logic programs based on partial evaluation. The Journal of Logic Programming 40 (1999), 1–46.

    Article  MATH  MathSciNet  Google Scholar 

  3. C. Beeri, R. Ramakrishnan: On the power of magic. The Journal of Logic Programming 10 (1991), 255–299.

    Article  MathSciNet  MATH  Google Scholar 

  4. S. Brass: Magic sets vs. SLD-resolution. In J. Eder, L. A. Kalinichenko (eds.), Advances in Databases and Information Systems (ADBIS’95), 185–203, Springer, 1995.

    Google Scholar 

  5. F. Bry: Query evaluation in recursive databases: bottom-up and top-down reconciled. Data & Knowledge Engineering 5 (1990), 289–312.

    Article  Google Scholar 

  6. A. Gupta, I. S. Mumick: Magic-sets transformation in nonrecursive systems. In Proc. of the Eleventh ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS’92), 354–367, 1992.

    Google Scholar 

  7. R. Himmeröder, G. Lausen, B. Ludäscher, C. Schlepphorst: On a declarative semantics for web queries. In Fifth International Conference on Deductive and Object-Oriented Databases (DOOD’97), 1997.

    Google Scholar 

  8. D. B. Kemp, K. Ramamohanarao, Z. Somogyi: Right-, left-and multi-linear rule transformations that maintain context information. In D. McLeod, R. Sacks-Davis, H. Schek (eds.), Proc. Very Large Data Bases, 16th Int. Conf. (VLDB’90), 380–391, Morgan Kaufmann Publishers, 1990.

    Google Scholar 

  9. D. Konopnicki, O. Shmueli: W3QS: A query system for the world-wide web. In U. Dayal, P. M. D. Gray, S. Nishio (eds.), Proc. of the 21st Int. Conf. on Very Large Data Bases, (VLDB’95), 54–65, Morgan Kaufmann, 1995.

    Google Scholar 

  10. I. S. Mumick, S. J. Finkelstein, H. Pirahesh, R. Ramakrishnan: Magic conditions. In Proc. of the Ninth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS’90), 314–330, 1990.

    Google Scholar 

  11. A. O. Mendelzon, G. Mihaila, T. Milo: Querying the world wide web. Journal of Digital Libraries 1 (1997), 68–88.

    Google Scholar 

  12. J. F. Naughton, R. Ramakrishnan, Y. Sagiv, J. D. Ullman: Efficient evaluation of right-, left-, and multi-linear rules. In Proceedings of the 1989 ACM SIGMOD International Conference on Management of Data, 235–242, 1989.

    Google Scholar 

  13. K. A. Ross: Modular acyclicity and tail recursion in logic programs. In Proc. of the Tenth ACM SIGACT-SIGMOD-SIGART Symp. on Princ. of Database Systems (PODS’91), 92–101, 1991.

    Google Scholar 

  14. R. Ramakrishnan, S. Sudarshan: Top-down vs. bottom-up revisited. In V. Saraswat, K. Ueda (eds.), Proc. of the 1991 Int. Symposium on Logic Programming, 321–336, MIT Press, 1991.

    Google Scholar 

  15. R. Ramakrishnan, D. Srivastava, S. Sudarshan, P. Seshadri: The CORAL deductive system. The VLDB Journal 3 (1994), 161–210.

    Article  Google Scholar 

  16. D. Srivastava, R. Ramakrishnan: Pushing constraint selections. In Proc. of the Eleventh ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS’92), 301–315, 1992.

    Google Scholar 

  17. S. Sudarshan, R. Ramakrishnan: Optimizations of bottom-up evaluation with non-ground terms. In D. Miller (ed.), Proceedings of the International Logic Programming Symposium (ILPS’93), 557–574, MIT Press, 1993.

    Google Scholar 

  18. K. Sagonas, T. Swift, D. S. Warren: XSB as an efficient deductive database engine. In R. T. Snodgrass, M. Winslett (eds.), Proc. of the 1994 ACM SIGMOD Int. Conf. on Management of Data (SIGMOD’94), 442–453, 1994.

    Google Scholar 

  19. J. D. Ullman: Bottom-up beats top-down for Datalog. In Proc. of the Eighth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS’89), 140–149, 1989.

    Google Scholar 

  20. J. D. Ullman: Principles of Database and Knowledge-Base Systems, Vol. 2. Computer Science Press, 1989.

    Google Scholar 

  21. U. Zukowski, S. Brass, B. Freitag: Improving the alternating fixpoint: The transformation approach. In A. Nerode (ed.), Proc. of the 4th Int. Conf. on Logic Programming and Non-Monotonic Reasoning (LPNMR’ 97), 40–59, LNAI 1265, Springer, 1997.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Brass, S. (2000). SLDMagic — The Real Magic (With Applications to Web Queries). In: Lloyd, J., et al. Computational Logic — CL 2000. CL 2000. Lecture Notes in Computer Science(), vol 1861. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44957-4_71

Download citation

  • DOI: https://doi.org/10.1007/3-540-44957-4_71

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-67797-0

  • Online ISBN: 978-3-540-44957-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics