[ASTERIXDB-3046][COMP] Support cost based query optimization.
- user model changes: yes
- storage format changes: no
- interface changes: yes
added: ICost, ICostMethods
modified: IAccessMethod
Details:
Cost based query optimization enables the optimizer to compute
the optimal plan for a query.
- Add new rule EnumerateJoinsRule to run the CBO logic.
- Add new rule AnnotateOperatorCostCardinalityRule to annotate
operators with cardinalities and costs.
- Add 3 compiler properties to control CBO:
compiler.cbo, compiler.forcejoinorder, compiler.queryplanshape
- Add 3 hints: hashjoin, selectivity, productivity.
- Add new operator annotations:
INPUT_CARDINALITY, OUTPUT_CARDINALITY, TOTAL_COST, OP_COST
LEFT_EXCHANGE_COST, RIGHT_EXCHANGE_COST
- Make tests run in CBO test mode.
Backport changes:
- Compensate for not having batch lookup change in this branch
Change-Id: I848adf6a8fdcfea360655ab649de2fb75a73c814
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17143
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ali Alsuliman <ali.al.solaiman@gmail.com>
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17329
Reviewed-by: Michael Blow <mblow@apache.org>
Tested-by: Michael Blow <mblow@apache.org>
diff --git a/asterixdb/asterix-app/src/main/resources/cc2.conf b/asterixdb/asterix-app/src/main/resources/cc2.conf
index 016c485..c746198 100644
--- a/asterixdb/asterix-app/src/main/resources/cc2.conf
+++ b/asterixdb/asterix-app/src/main/resources/cc2.conf
@@ -48,6 +48,9 @@
[common]
log.dir = logs/
log.level = WARN
+compiler.cbo=false
+compiler.cbotest=true
+compiler.queryplanshape=zigzag
compiler.framesize=32KB
compiler.sortmemory=320KB
compiler.groupmemory=160KB