Repository logo

Infoscience

  • English
  • French
Log In
Logo EPFL, École polytechnique fédérale de Lausanne

Infoscience

  • English
  • French
Log In
  1. Home
  2. Academic and Research Output
  3. Conferences, Workshops, Symposiums, and Seminars
  4. Static Typing Meets Adaptive Optimization: A Unified Approach to Recursive Queries
 
conference paper

Static Typing Meets Adaptive Optimization: A Unified Approach to Recursive Queries

Herlihy, Anna  
•
Ailamaki, Anastasia  
•
Odersky, Martin  
June 22, 2025
Proceedings of the 19th International Symposium on Database Programming Languages
SIGMOD/PODS '25: International Conference on Management of Data

Writing correct and efficient recursive SQL queries is exceptionally challenging because recursive queries risk returning incorrect results, throwing runtime exceptions, or never terminating. Failures in recursive query execution fall into two categories: non-recoverable failures, such as nontermination or database error, which must be identified statically, and recoverable failures, which arise from incorrect assumptions about program behavior - for example, the optimal join order based on input relations may no longer be optimal after execution begins - leading to severe performance degradation. We present CaQL, a unified recursive query framework that statically enforces correctness properties at the type level while supporting runtime query optimization through multi-stage programming. CaQL unifies two existing systems under a shared architecture: TyQL, a statically typed, language-integrated query framework, and Carac, an adaptive recursive query engine that uses runtime metaprogramming to reoptimize queries based on observed behavior. CaQL leverages bidirectional information flow between TyQL and Carac to make static correctness checks more precise and runtime optimizations more aggressive, enabling behavior that neither system achieves independently. We evaluate CaQL on queries drawn from recursive SQL benchmarks, graph analytics, and program analysis, demonstrating the safety and convenience of language-integrated query with performance competitive with or superior to a state-of-the-art Datalog engine.

  • Details
  • Metrics
Type
conference paper
DOI
10.1145/3735106.3736533
Author(s)
Herlihy, Anna  

EPFL

Ailamaki, Anastasia  

EPFL

Odersky, Martin  

EPFL

Date Issued

2025-06-22

Publisher

ACM

Publisher place

New York, NY, USA

Published in
Proceedings of the 19th International Symposium on Database Programming Languages
ISBN of the book

979-8-4007-1919-6

Start page

1

End page

6

Editorial or Peer reviewed

REVIEWED

Written at

EPFL

EPFL units
DIAS  
LAMP1  
Event nameEvent acronymEvent placeEvent date
SIGMOD/PODS '25: International Conference on Management of Data

SIGMOD/PODS '25

Berlin, Germany

2025-06-22 - 2025-06-27

FunderFunding(s)Grant NumberGrant URL

SNSF

209506

Available on Infoscience
June 26, 2025
Use this identifier to reference this record
https://infoscience.epfl.ch/handle/20.500.14299/251627
Logo EPFL, École polytechnique fédérale de Lausanne
  • Contact
  • infoscience@epfl.ch

  • Follow us on Facebook
  • Follow us on Instagram
  • Follow us on LinkedIn
  • Follow us on X
  • Follow us on Youtube
AccessibilityLegal noticePrivacy policyCookie settingsEnd User AgreementGet helpFeedback

Infoscience is a service managed and provided by the Library and IT Services of EPFL. © EPFL, tous droits réservés