Handling Environments in a Nested Relational Algebra with Combinators and an Implementation in a Verified Query Compiler

被引:6
|
作者
Auerbach, Joshua S. [1 ]
Hirzel, Martin [1 ]
Mandel, Louis [1 ]
Shinnar, Avraham [1 ]
Simeon, Jerome [1 ]
机构
[1] IBM Res, 1101 Kitchawan Rd, Yorktown Hts, NY 10598 USA
关键词
D O I
10.1145/3035918.3035961
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Algebras based on combinators, i.e., variable-free, have been proposed as a better representation for query compilation and optimization. A key benefit of combinators is that they avoid the need to handle variable shadowing or accidental capture during rewrites. This simplifies both the optimizer specification and its correctness analysis, but the environment from the source language has to be reified as records, which can lead to more complex query plans. This paper proposes NRA(e), an extension of a combinators-based nested relational algebra (NRA) with built-in support for environments. We show that it can naturally encode an equivalent NRA with lambda terms and that all optimizations on NRA carry over to NRA(e). This extension provides an elegant way to represent views in query plans, and can radically simplify compilation and optimization for source languages with rich environment manipulations. We have specified a query compiler using the Coq proof assistant with NRA(e) at its heart. Most of the compiler, including the query optimizer, is accompanied by a (machinechecked) correctness proof. The implementation is automatically extracted from the specification, resulting in a query compiler with a verified core.
引用
收藏
页码:1555 / 1569
页数:15
相关论文
共 2 条
  • [1] SQL query optimization through nested relational algebra
    Cao, Bin
    Badia, Antonio
    ACM TRANSACTIONS ON DATABASE SYSTEMS, 2007, 32 (03):
  • [2] Implementation of Relational Algebra Interpreter using another query language
    Litoriya, Ratnesh
    Ranjan, Anshu
    PROCEEDINGS OF THE INTERNATIONAL CONFERENCE ON DATA STORAGE AND DATA ENGINEERING (DSDE 2010), 2010, : 24 - 28