diff --git a/src/optimizer/build_probe_side_optimizer.cpp b/src/optimizer/build_probe_side_optimizer.cpp index 74d3c3aa0d1..ac7e4ff2d14 100644 --- a/src/optimizer/build_probe_side_optimizer.cpp +++ b/src/optimizer/build_probe_side_optimizer.cpp @@ -116,7 +116,7 @@ double BuildProbeSideOptimizer::GetBuildSize(vector types, const id // There is also a cost of NextPowerOfTwo(count * 2) * sizeof(data_ptr_t) per tuple in the hash table // This is a not a smooth cost function, so instead we do the average, which is ~3 * sizeof(data_ptr_t) - row_width += 3.0 * sizeof(data_ptr_t); + row_width += 3 * sizeof(data_ptr_t); return static_cast(row_width * cardinality); } @@ -144,6 +144,8 @@ void BuildProbeSideOptimizer::TryFlipJoinChildren(LogicalOperator &op) { auto &left_side_build_cost = build_sizes.left_side; auto &right_side_build_cost = build_sizes.right_side; + Printer::PrintF("LHS: %f, RHS: %f", left_side_build_cost, right_side_build_cost); + bool swap = false; idx_t left_child_joins = ChildHasJoins(*op.children[0]); diff --git a/src/optimizer/join_order/relation_manager.cpp b/src/optimizer/join_order/relation_manager.cpp index aee17843e6c..b3cec72ad06 100644 --- a/src/optimizer/join_order/relation_manager.cpp +++ b/src/optimizer/join_order/relation_manager.cpp @@ -111,9 +111,11 @@ bool ExpressionContainsColumnRef(Expression &expression) { if (expression.type == ExpressionType::BOUND_COLUMN_REF) { // Here you have a filter on a single column in a table. Return a binding for the column // being filtered on so the filter estimator knows what HLL count to pull +#ifdef DEBUG auto &colref = expression.Cast(); D_ASSERT(colref.depth == 0); D_ASSERT(colref.binding.table_index != DConstants::INVALID_INDEX); +#endif // map the base table index to the relation index used by the JoinOrderOptimizer return true; }