Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 948 Bytes

File metadata and controls

50 lines (36 loc) · 948 Bytes

BetterSQL™ - an attempt at a SQL optimizer

This is a (very) rough prototype for SQL optimization in OCaml.

Build

You will first need to install OCaml and OPAM.

On macOS with Homebrew

brew intall ocaml
brew install opam

Clone this project

git clone https://github.com/richardwu/better-sql.git

and run

make setup
make build

Interactive

To interactively test this, simply download utop, and load the necessary definitions from the source files. For example (in topological order of dependencies):

#use "table.ml";;

#use "columnsPerTable.ml";;

#use "columns.ml";;

#use "expr.ml";;

open Expr;;    (* elides the need to prefix with module name *)
let e1 = fromOp(SCAN(Table.fromName "a"));;
Columns.prettyprint (columns e1);;

Testing

make test