This repository was archived by the owner on Jan 28, 2021. It is now read-only.
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
Rules review #294
Closed
Description
To try to reduce errors in rules interactions, I wrote some guidelines to improve and simplify that rules:
Rules guideline
- We have two kind of rules: resolution rules, and optimization rules.
- The goal of resolution rules is to transform the parsed tree resolving abstract references (e.g. to column names and expressions) into concrete references (e.g. resolved columns referencing an exact position in a row). Since, in our model, every resolved node is also executable, physical planning is also implicit in this phase.
- The goal of optimization rules is to make the query faster.
- If a query tree is not resolved after resolution rules, the query must throw an error.
- Each rule must do only one thing and be as small as possible.
- Each rule must return a valid query tree.
- On resolution rules, the output query tree might not be fully resolved, and that's ok.
- On optimization rules, both the input and output trees must be resolved (and, therefore, executable).
- Rules are expected to work well between them, but a rule cannot depend on other rule/rules to generate a valid query tree.
Apply that on rules that do not accomplish it.