(
dataflow: &mut DataflowDesc,
ctx: &mut TransformCtx,
)
| 419 | fields(path.segment ="monotonic") |
| 420 | )] |
| 421 | pub fn optimize_dataflow_monotonic( |
| 422 | dataflow: &mut DataflowDesc, |
| 423 | ctx: &mut TransformCtx, |
| 424 | ) -> Result<(), TransformError> { |
| 425 | let mut monotonic_ids = BTreeSet::new(); |
| 426 | for (source_id, source_import) in dataflow.source_imports.iter() { |
| 427 | if source_import.monotonic { |
| 428 | monotonic_ids.insert(source_id.clone()); |
| 429 | } |
| 430 | } |
| 431 | for ( |
| 432 | _index_id, |
| 433 | IndexImport { |
| 434 | desc: index_desc, |
| 435 | monotonic, |
| 436 | .. |
| 437 | }, |
| 438 | ) in dataflow.index_imports.iter() |
| 439 | { |
| 440 | if *monotonic { |
| 441 | monotonic_ids.insert(index_desc.on_id.clone()); |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | let monotonic_flag = MonotonicFlag::default(); |
| 446 | |
| 447 | for build_desc in dataflow.objects_to_build.iter_mut() { |
| 448 | monotonic_flag.transform(build_desc.plan.as_inner_mut(), ctx, &monotonic_ids)?; |
| 449 | } |
| 450 | |
| 451 | mz_repr::explain::trace_plan(dataflow); |
| 452 | |
| 453 | Ok(()) |
| 454 | } |
| 455 | |
| 456 | /// Determine whether we require snapshots from our durable source imports. |
| 457 | /// (For example, these can often be skipped for simple subscribe queries.) |
no test coverage detected