-
Notifications
You must be signed in to change notification settings - Fork 623
Optimizer refactor and cost model additions #1484
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good. Some minor comments.
@@ -35,9 +37,16 @@ class OptimizerMetadata { | |||
settings::SettingId::task_execution_timeout)), | |||
timer(Timer<std::milli>()) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarity, do we still need this method here?
namespace peloton { | ||
namespace optimizer { | ||
|
||
double PostgresCostCalculator::CalculateCost( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, is this exactly the same of Postgres query optimizer? Including the DEFAULT_TUPLE_COST or DEFAULT_INDEX_TUPLE_COST?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Postgres does it a bit different as far as I can tell. While we have a cost per tuple, postgres estimates a cost for hashing a predicate to cost hash joins. This is something we could try to implement but would require more complex estimators that should probably be in a separate PR
…sts, along with more optimizer test utility functions
@GustavoAngulo I would not worry about getting this to work on Travis since we're not maintaining it. |
This reverts commit fcbf161.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just merging this. We will review when we move to new DBMS.
* Separate cost model from optimizer and add postgres cost model * Fix bug overflow in Analyze * Changes to cost model construction * Fix bug in stats hashing * Fix to commutativity of equality comparison expressions * Revert group equality, this works * Move Postgres cost model to header file and add some starting plan tests, along with more optimizer test utility functions * Remove printf * Remove old optimizer constructor * Fix unused variable * Testing if changing llvm path fixes travis * Did not work : ( * Ok trying changing to 3.9.1_2 * Revert "Fix bug overflow in Analyze" This reverts commit fcbf161. * Update LLVM dir in travis config * Add trivial cost model * Move files into stats folder * Add test cases for trivial cost model * Delete cost.h and cost.cpp that were commented out * Cost model name and directory refactoring * Fix three join test
This PR adds a ton of different things before we move over the optimizer to terrier:
optimizer/stats
, and all cost model files are underoptimizer/cost_model
optimizer/cost_model/trivial_cost_model.h
. This can be used for debugging or trivial execution. It does not use any statistics, it can be thought of as heuristic based.optimizer/stats/stats_util.h