Skip to content
An attempt at a SQL optimizer in OCaml.
OCaml Standard ML Makefile
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
Makefile
README.md
cnf.ml
cnf.mli
cnf_test.ml
columns.ml
columns.mli
columnsPerTable.ml
columnsPerTable.mli
expr.ml
expr.mli
props_test.ml
pushdown.ml
table.ml
table.mli

README.md

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
You can’t perform that action at this time.