Skip to content

Latest commit

 

History

History
135 lines (114 loc) · 9.7 KB

101-query-compilation.md

File metadata and controls

135 lines (114 loc) · 9.7 KB

Query Compilation 101

Prerequisite videos

Current Compiler Pipeline

Representations:

  • SQL — source language
  • AST — a parsed version of a SQL query.
  • HIR — high-level intermediate representation.
  • MIR — mid-level intermediate representation.
  • LIR — low-level intermediate representation.
  • TDO — target language (timely & differential operators).

Transformations in the compile-time lifecycle of a SQL statement.

Currently, the optimization team is mostly concerned with the HIR ⇒ MIR and MIR ⇒ MIR stages.

Testing

Integration tests

  • Sqllogictest
    • Philip’s RQG tests will be in this format.
      • Add Philip to any PR where query plans may change.
    • A PR can be merged if it passes Fast SLT.
    • A PR does not need to pass Full SLT tests (test/sqllogictest/sqlite) to be merged.
      • Full SLT tests take 2-3 hours.
      • You can manually initiate full SLT tests on your branch here.
  • Testdrive

Unit tests

Performance tests

Tooling

  • mzt — can be used to create repositories of plans and write up a markdown that explains something based on those plans (see Alexander’s mzt-repos for example).