(
&self,
relation: &mut MirRelationExpr,
_: &mut TransformCtx,
)
| 51 | fields(path.segment = "join_fusion") |
| 52 | )] |
| 53 | fn actually_perform_transform( |
| 54 | &self, |
| 55 | relation: &mut MirRelationExpr, |
| 56 | _: &mut TransformCtx, |
| 57 | ) -> Result<(), TransformError> { |
| 58 | // We need to stick with post-order here because `action` only fuses a |
| 59 | // Join with its direct children. This means that we can only fuse a |
| 60 | // tree of Join nodes in a single pass if we work bottom-up. |
| 61 | let mut transformed = false; |
| 62 | relation.try_visit_mut_post(&mut |relation| { |
| 63 | transformed |= Self::action(relation)?; |
| 64 | Ok::<_, TransformError>(()) |
| 65 | })?; |
| 66 | // If the action applied in the non-trivial case, run PredicatePushdown |
| 67 | // and CanonicalizeMfp in order to re-construct an equi-Join which would |
| 68 | // be de-constructed as a Filter + CrossJoin by the action application. |
| 69 | // |
| 70 | // TODO(database-issues#7728): This is a temporary solution which fixes the "Product |
| 71 | // limits" issue observed in a failed Nightly run when the PR was first |
| 72 | // tested (https://buildkite.com/materialize/nightly/builds/6670). We |
| 73 | // should re-evaluate if we need this ad-hoc re-normalization step when |
| 74 | // LiteralLifting is removed in favor of EquivalencePropagation. |
| 75 | if transformed { |
| 76 | PredicatePushdown::default().action(relation, &mut BTreeMap::new())?; |
| 77 | CanonicalizeMfp.action(relation)? |
| 78 | } |
| 79 | mz_repr::explain::trace_plan(&*relation); |
| 80 | Ok(()) |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | impl Join { |
nothing calls this directly
no test coverage detected