cmu-db / peloton

The Self-Driving Database Management System
http://pelotondb.io
Apache License 2.0
2.04k stars 622 forks source link

[15721] Query Rewrite #1340

Closed zhaoguoquan94 closed 6 years ago

zhaoguoquan94 commented 6 years ago

This PR adds support for query rewriting optimizations that are oblivious to the cost model in Peloton.

We implement query rewrite rules using the current optimizer framework:

Constant folding can transform queries like select * from table where t.column1 = 3*(2-1) to select * from table where t.column1 = 3. These transformation are done in parser level instead of optimizer level because of implementation simplicity. And we don't really lose any information. It support 3 type of constant folding

  1. Operators like +-*/
  2. Comparison operators like >=, NOT, is null,
  3. Conjunctions : AND OR.
apavlo commented 6 years ago

Closing. We will have @Zeninma build this in the fall with a proper rewrite layer.