Queries with External Predicates

Authors Paolo Guagliardo , Leonid Libkin , Victor Marsault , Wim Martens , Filip Murlak , Liat Peterfreund , Cristina Sirangelo



PDF
Thumbnail PDF

File

LIPIcs.ICDT.2025.22.pdf
  • Filesize: 0.9 MB
  • 20 pages

Document Identifiers

Author Details

Paolo Guagliardo
  • University of Edinburgh, UK
Leonid Libkin
  • RelationalAI and IRIF, CNRS, Paris, France
  • University of Edinburgh, UK
Victor Marsault
  • LIGM, Université Gustave Eiffel, CNRS, France
Wim Martens
  • University of Bayreuth, Germany
  • RelationalAI, Berkeley, CA, USA
Filip Murlak
  • University of Warsaw, Poland
Liat Peterfreund
  • The Hebrew University of Jerusalem, Israel
Cristina Sirangelo
  • Université Paris Cité, CNRS, IRIF, F-75013, Paris, France

Cite As Get BibTex

Paolo Guagliardo, Leonid Libkin, Victor Marsault, Wim Martens, Filip Murlak, Liat Peterfreund, and Cristina Sirangelo. Queries with External Predicates. In 28th International Conference on Database Theory (ICDT 2025). Leibniz International Proceedings in Informatics (LIPIcs), Volume 328, pp. 22:1-22:20, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2025) https://doi.org/10.4230/LIPIcs.ICDT.2025.22

Abstract

Real-life query languages feature external predicates such as user-defined functions or built-in arithmetic and string operations. These predicates are often infinite, potentially leading to unsafe or non-computable queries. To overcome this, traditional languages such as SQL, put significant syntactic restrictions on the use of external predicates. These restrictions have been relaxed in a number of modern query languages, each doing it in their own way. Our goal therefore is to provide a theoretical basis for querying with external predicates. To this end, we formalize queries with external predicates based on the notion of access patterns. We develop a suitable evaluation model, based on Turing machines with oracles, and tailor the classical notion of query safety to it. Since query safety is undecidable in general, we can only produce sufficient conditions for guaranteeing safety. We do so by developing an inference system to derive safety and computability for relational algebra, first-order logic, as well as for a language that combines them both.

Subject Classification

ACM Subject Classification
  • Theory of computation → Database theory
Keywords
  • External predicates
  • Query safety
  • Computational model
  • Oracles
  • Infinite predicates
  • Access patterns
  • Relational algebra
  • First-order logic

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Serge Abiteboul, Richard Hull, and Victor Vianu. Foundations of Databases. Addison-Wesley, 1995. Google Scholar
  2. Marcelo Arenas, Pablo Barceló, Leonid Libkin, Wim Martens, and Andreas Pieris. Database Theory. Open source at https://github.com/pdm-book/community, 2022.
  3. Michael Armbrust, Eric Liang, Tim Kraska, Armando Fox, Michael J. Franklin, and David A. Patterson. Generalized scale independence through incremental precomputation. In Kenneth A. Ross, Divesh Srivastava, and Dimitris Papadias, editors, Proceedings of the ACM SIGMOD International Conference on Management of Data, SIGMOD 2013, New York, NY, USA, June 22-27, 2013, pages 625-636. ACM, 2013. URL: https://doi.org/10.1145/2463676.2465333.
  4. S. Arora and B. Barak. Computational Complexity: A Modern Approach. Cambridge University Press, 2006. URL: https://theory.cs.princeton.edu/complexity/book.pdf.
  5. Pavel Avgustinov, Oege de Moor, Michael Peyton Jones, and Max Schäfer. QL: object-oriented queries on relational data. In Shriram Krishnamurthi and Benjamin S. Lerner, editors, 30th European Conference on Object-Oriented Programming, ECOOP 2016, July 18-22, 2016, Rome, Italy, volume 56 of LIPIcs, pages 2:1-2:25. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2016. URL: https://doi.org/10.4230/LIPICS.ECOOP.2016.2.
  6. D. R. Bean. Recursive Euler and Hamilton paths. Proc. Amer. Math. Soc., 55:385-394, 1976. Google Scholar
  7. Richard Beigel and William I. Gasarch. On the complexity of finding the chromatic number of a recursive graph I: the bounded case. Ann. Pure Appl. Log., 45(1):1-38, 1989. URL: https://doi.org/10.1016/0168-0072(89)90029-8.
  8. Michael Benedikt and Leonid Libkin. Safe constraint queries. SIAM J. Comput., 29(5):1652-1682, 2000. URL: https://doi.org/10.1137/S0097539798342484.
  9. Yang Cao, Wenfei Fan, and Tengfei Yuan. Bounded evaluation: Querying big data with bounded resources. Int. J. Autom. Comput., 17(4):502-526, 2020. URL: https://doi.org/10.1007/S11633-020-1236-1.
  10. Ashok K. Chandra and David Harel. Computable queries for relational data bases. J. Comput. Syst. Sci., 21(2):156-178, 1980. URL: https://doi.org/10.1016/0022-0000(80)90032-X.
  11. Sara Cohen, Joseph (Yossi) Gil, and Evelina Zarivach. Datalog programs over infinite databases, revisited. In Marcelo Arenas and Michael I. Schwartzbach, editors, Database Programming Languages, pages 32-47, Berlin, Heidelberg, 2007. Springer Berlin Heidelberg. Google Scholar
  12. Alin Deutsch, Bertram Ludäscher, and Alan Nash. Rewriting queries using views with access patterns under integrity constraints. Theor. Comput. Sci., 371(3):200-226, 2007. URL: https://doi.org/10.1016/J.TCS.2006.11.008.
  13. Wenfei Fan, Floris Geerts, and Leonid Libkin. On scale independence for querying big data. In Richard Hull and Martin Grohe, editors, Proceedings of the 33rd ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, PODS'14, Snowbird, UT, USA, June 22-27, 2014, pages 51-62. ACM, 2014. URL: https://doi.org/10.1145/2594538.2594551.
  14. Daniela Florescu, Alon Y. Levy, Ioana Manolescu, and Dan Suciu. Query optimization in the presence of limited access patterns. In Alex Delis, Christos Faloutsos, and Shahram Ghandeharizadeh, editors, SIGMOD 1999, Proceedings ACM SIGMOD International Conference on Management of Data, June 1-3, 1999, Philadelphia, Pennsylvania, USA, pages 311-322. ACM Press, 1999. URL: https://doi.org/10.1145/304182.304210.
  15. Erich Grädel and Yuri Gurevich. Metafinite model theory. Inf. Comput., 140(1):26-81, 1998. URL: https://doi.org/10.1006/INCO.1997.2675.
  16. Erich Grädel, Phokion G. Kolaitis, Leonid Libkin, Maarten Marx, Joel Spencer, Moshe Y. Vardi, Yde Venema, and Scott Weinstein. Finite Model Theory and Its Applications. Texts in Theoretical Computer Science. An EATCS Series. Springer, 2007. URL: https://doi.org/10.1007/3-540-68804-8.
  17. Tirza Hirst and David Harel. Completeness results for recursive data bases. In Catriel Beeri, editor, Proceedings of the Twelfth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, May 25-28, 1993, Washington, DC, USA, pages 244-252. ACM Press, 1993. URL: https://doi.org/10.1145/153850.153905.
  18. Tirza Hirst and David Harel. More about recursive structures: Descriptive complexity and zero-one laws. In Proceedings, 11th Annual IEEE Symposium on Logic in Computer Science, New Brunswick, New Jersey, USA, July 27-30, 1996, pages 334-347. IEEE Computer Society, 1996. URL: https://doi.org/10.1109/LICS.1996.561361.
  19. Herbert Jordan, Bernhard Scholz, and Pavle Subotic. Soufflé: On synthesis of program analyzers. In Swarat Chaudhuri and Azadeh Farzan, editors, Computer Aided Verification - 28th International Conference, CAV 2016, Toronto, ON, Canada, July 17-23, 2016, Proceedings, Part II, volume 9780 of Lecture Notes in Computer Science, pages 422-430. Springer, 2016. URL: https://doi.org/10.1007/978-3-319-41540-6_23.
  20. Ahmet Kara, Milos Nikolic, Dan Olteanu, and Haozhe Zhang. Conjunctive queries with free access patterns under updates. In Floris Geerts and Brecht Vandevoort, editors, 26th International Conference on Database Theory, ICDT 2023, March 28-31, 2023, Ioannina, Greece, volume 255 of LIPIcs, pages 17:1-17:20. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2023. URL: https://doi.org/10.4230/LIPICS.ICDT.2023.17.
  21. Gabriel Kuper, Leonid Libkin, and Jan Paredaens. Constraint Databases. Springer, 2000. Google Scholar
  22. Chen Li. Computing complete answers to queries in the presence of limited access patterns. VLDB J., 12(3):211-227, 2003. URL: https://doi.org/10.1007/S00778-002-0085-6.
  23. Chen Li and Edward Y. Chang. On answering queries in the presence of limited access patterns. In Jan Van den Bussche and Victor Vianu, editors, Database Theory - ICDT 2001, 8th International Conference, London, UK, January 4-6, 2001, Proceedings, volume 1973 of Lecture Notes in Computer Science, pages 219-233. Springer, 2001. URL: https://doi.org/10.1007/3-540-44503-X_15.
  24. Leonid Libkin. Elements of Finite Model Theory. Texts in Theoretical Computer Science. An EATCS Series. Springer, 2004. URL: https://doi.org/10.1007/978-3-662-07003-1.
  25. Alan Nash and Bertram Ludäscher. Processing first-order queries under limited access patterns. In Catriel Beeri and Alin Deutsch, editors, Proceedings of the Twenty-third ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, June 14-16, 2004, Paris, France, pages 307-318. ACM, 2004. URL: https://doi.org/10.1145/1055558.1055601.
  26. Alan Nash and Bertram Ludäscher. Processing unions of conjunctive queries with negation under limited access patterns. In Advances in Database Technology - EDBT 2004, 9th International Conference on Extending Database Technology, Heraklion, Crete, Greece, March 14-18, 2004, Proceedings, volume 2992 of Lecture Notes in Computer Science, pages 422-440. Springer, 2004. URL: https://doi.org/10.1007/978-3-540-24741-8_25.
  27. R. Ramakrishnan, F. Bancilhon, and A. Silberschatz. Safety of recursive horn clauses with infinite relations. In Proceedings of the Sixth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, PODS '87, pages 328-339, New York, NY, USA, 1987. Association for Computing Machinery. URL: https://doi.org/10.1145/28659.28694.
  28. RelationalAI, 2024. URL: https://learn.relational.ai/.
  29. Y. Sagiv and M. Y. Vardi. Safety of datalog queries over infinite databases. In Proceedings of the Eighth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, PODS '89, pages 160-171, New York, NY, USA, 1989. Association for Computing Machinery. URL: https://doi.org/10.1145/73721.73738.
  30. Alexei P. Stolboushkin and Michael A. Taitslin. Finite queries do not have effective syntax. Inf. Comput., 153(1):99-116, 1999. URL: https://doi.org/10.1006/INCO.1999.2792.
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail