Skip to content

Commit 624d040

Browse files
committed
fix all join tests
1 parent be71afb commit 624d040

File tree

1 file changed

+12
-13
lines changed
  • optd-cost-model/src/cost/join

1 file changed

+12
-13
lines changed

optd-cost-model/src/cost/join/core.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -385,22 +385,22 @@ impl<S: CostModelStorageManager> CostModelImpl<S> {
385385
let right_attr_ref =
386386
&attr_refs[on_attr_ref_pair.1.attr_index() as usize + right_attr_ref_offset];
387387

388-
if let (AttrRef::BaseTableAttrRef(left), AttrRef::BaseTableAttrRef(right)) =
389-
(left_attr_ref, right_attr_ref)
390-
{
391-
let predicate = EqPredicate::new(left.clone(), right.clone());
392-
return self
393-
.get_join_selectivity_adjustment_when_adding_to_multi_equality_graph(
388+
selectivity *=
389+
if let (AttrRef::BaseTableAttrRef(left), AttrRef::BaseTableAttrRef(right)) =
390+
(left_attr_ref, right_attr_ref)
391+
{
392+
let predicate = EqPredicate::new(left.clone(), right.clone());
393+
self.get_join_selectivity_adjustment_when_adding_to_multi_equality_graph(
394394
&predicate,
395395
&mut past_eq_attrs,
396396
)
397-
.await;
398-
}
399-
400-
selectivity *= self
401-
.get_join_selectivity_from_on_attr_ref_pair(left_attr_ref, right_attr_ref)
402-
.await?;
397+
.await?
398+
} else {
399+
self.get_join_selectivity_from_on_attr_ref_pair(left_attr_ref, right_attr_ref)
400+
.await?
401+
};
403402
}
403+
404404
Ok(selectivity)
405405
}
406406
}
@@ -1103,7 +1103,6 @@ mod tests {
11031103
/// first join. There can only be one condition because only two tables are involved at
11041104
/// the time of the first join.
11051105
#[tokio::test]
1106-
#[ignore = "fail"]
11071106
#[test_case::test_case(&[(0, 1)])]
11081107
#[test_case::test_case(&[(0, 2)])]
11091108
#[test_case::test_case(&[(1, 2)])]

0 commit comments

Comments
 (0)