Skip to main content

A Rule-Based Approach to Analyzing Database Schema Objects with Datalog

  • Conference paper
  • First Online:
Logic-Based Program Synthesis and Transformation (LOPSTR 2017)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 10855))

Abstract

Database schema elements such as tables, views, triggers and functions are typically defined with many interrelations. In order to support database users in understanding a given schema, a rule-based approach for analyzing the respective dependencies is proposed using Datalog expressions. We show that many interesting properties of schema elements can be systematically determined this way. The expressiveness of the proposed analysis is exemplarily shown with the problem of computing induced functional dependencies for derived relations. The propagation of functional dependencies plays an important role in data integration and query optimization but represents an undecidable problem in general. And yet, our rule-based analysis covers all relational operators as well as linear recursive expressions in a systematic way showing the depth of analysis possible by our proposal. The analysis of functional dependencies is well-integrated in a uniform approach to analyzing dependencies between schema elements in general.

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

Access this chapter

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 EPUB and 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

Notes

  1. 1.

    An in-depth discussion on the complexity can be found in [12].

  2. 2.

    Finite domains cause troubles as FDs can occur due to the fact of limited possible value combinations without being induced by another FD (cf. [12]).

  3. 3.

    A subsumption step could be added for avoiding redundant FD representations.

References

  1. Aho, A.V., Beeri, C., Ullman, J.D.: The theory of joins in relational databases. TODS 4(3), 297–314 (1979)

    Article  Google Scholar 

  2. Armstrong, W.W.: Dependency structures of data base relationships. In: IFIP Congress 1974, pp. 580–583 (1974)

    Google Scholar 

  3. Behrend, A., Manthey, R.: A transformation-based approach to view updating in stratifiable deductive databases. In: Hartmann, S., Kern-Isberner, G. (eds.) FoIKS 2008. LNCS, vol. 4932, pp. 253–271. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-77684-0_18

    Chapter  Google Scholar 

  4. Boehm, A.M., Seipel, D., Sickmann, A., Wetzka, M.: Squash: a tool for analyzing, tuning and refactoring relational database applications. In: Seipel, D., Hanus, M., Wolf, A. (eds.) INAP/WLP 2007. LNCS (LNAI), vol. 5437, pp. 82–98. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-00675-3_6

    Chapter  Google Scholar 

  5. Brass, S., Goldberg, C.: Proving the safety of SQL queries. In: QSIC 2005, pp. 197–204 (2005)

    Google Scholar 

  6. Brass, S.: Language constructs for a datalog compiler. In: Benslimane, D., Damiani, E., Grosky, W.I., Hameurlain, A., Sheth, A., Wagner, R.R. (eds.) DEXA 2017. LNCS, vol. 10438, pp. 130–140. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-64468-4_10

    Chapter  Google Scholar 

  7. Brisaboa, N.R., González, A., Hernández, H.J., Paramá, J.R.: The chase of datalog programs. In: Embury, S.M., Fiddian, N.J., Gray, W.A., Jones, A.C. (eds.) BNCOD 1998. LNCS, vol. 1405, pp. 165–166. Springer, Heidelberg (1998). https://doi.org/10.1007/BFb0053479

    Chapter  Google Scholar 

  8. Calì, A., Calvanese, D., De Giacomo, G., Lenzerini, M.: Data integration under integrity constraints. Inf. Syst. 29(2), 147–163 (2004)

    Article  Google Scholar 

  9. Davidson, S.B., Fan, W., Hara, C.S., Qin, J.: Propagating XML constraints to relations. In: ICDE 2003, pp. 543–554 (2003)

    Google Scholar 

  10. Delobel, C., Adiba, M.: Relational Database Systems. Elsevier, New York (1985)

    MATH  Google Scholar 

  11. Fagin, R., Kolaitis, P.G., Popa, L., Tan, W.C.: Reverse data exchange: coping with nulls. In: PODS 2009, pp. 23–32 (2009)

    Google Scholar 

  12. Fan, W., Ma, S., Hu, Y., Liu, J., Wu, Y.: Propagating functional dependencies with conditions. PVLDB 1(1), 391–407 (2008)

    Google Scholar 

  13. Herrmann, K., Voigt, H., Behrend, A., Rausch, J., Lehner, W.: Living in parallel realities - co-existing schema versions with a bidirectional database evolution language. In: SIGMOD 2017, pp. 1101–1116 (2017)

    Google Scholar 

  14. Hill, P.M., Lloyd, J.W.: Analysis of meta-programs. In: Meta-Programming in Logic Programming, pp. 23–51 (1989)

    Google Scholar 

  15. Klug, A.C.: Calculating constraints on relational expressions. TODS 5(3), 260–290 (1980)

    Article  Google Scholar 

  16. Klug, A.C., Price, R.: Determining view dependencies using tableaux. TODS 7(3), 361–380 (1982)

    Article  MathSciNet  Google Scholar 

  17. Maier, D., Mendelzon, A.O., Sagiv, Y.: Testing implications of data dependencies. TODS 4(4), 455–469 (1979)

    Article  Google Scholar 

  18. Maule, A., Emmerich, W., Rosenblum, D.S.: Impact analysis of database schema changes. In: ICSE 2008, pp. 451–460 (2008)

    Google Scholar 

  19. Milo, T., Zohar, S.: Using schema matching to simplify heterogeneous data translation. In: VLDB 1998, pp. 122–133 (1998)

    Google Scholar 

  20. Paramá, J.R., Brisaboa, N.R., Penabad, M.R., Places, Á.S.: A semantic query optimization approach to optimize linear datalog programs. In: Manolopoulos, Y., Návrat, P. (eds.) ADBIS 2002. LNCS, vol. 2435, pp. 277–290. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45710-0_22

    Chapter  MATH  Google Scholar 

  21. Paramá, J.R., Brisaboa, N.R., Penabad, M.R., Places, Á.S.: Implication of functional dependencies for recursive queries. In: Broy, M., Zamulin, A.V. (eds.) PSI 2003. LNCS, vol. 2890, pp. 509–519. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-39866-0_49

    Chapter  MATH  Google Scholar 

  22. Wang, K., Yuan, L.: Preservation of integrity constraints in definite DATALOG programs. Inf. Process. Lett. 44(4), 185–193 (1992)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Christiane Engels .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Engels, C., Behrend, A., Brass, S. (2018). A Rule-Based Approach to Analyzing Database Schema Objects with Datalog. In: Fioravanti, F., Gallagher, J. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2017. Lecture Notes in Computer Science(), vol 10855. Springer, Cham. https://doi.org/10.1007/978-3-319-94460-9_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-94460-9_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-94459-3

  • Online ISBN: 978-3-319-94460-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics