Computes the best join orders for each input. If there are N inputs, returns N orders, with the ith input starting the ith order.
(
equivalences: &[Vec<MirScalarExpr>], // join equivalences: inside a Vec, the exprs are equivalent
available: &[Vec<Vec<MirScalarExpr>>], // available arrangements per input
unique_keys:
| 1008 | // |
| 1009 | // If there are N inputs, returns N orders, with the ith input starting the ith order. |
| 1010 | fn optimize_orders( |
| 1011 | equivalences: &[Vec<MirScalarExpr>], // join equivalences: inside a Vec, the exprs are equivalent |
| 1012 | available: &[Vec<Vec<MirScalarExpr>>], // available arrangements per input |
| 1013 | unique_keys: &[Vec<Vec<usize>>], // unique keys per input |
| 1014 | cardinalities: &[Option<usize>], // cardinalities of input relations |
| 1015 | filters: &[FilterCharacteristics], // filter characteristics per input |
| 1016 | input_mapper: &JoinInputMapper, // join helper |
| 1017 | enable_join_prioritize_arranged: bool, |
| 1018 | ) -> Result<Vec<Vec<(JoinInputCharacteristics, Vec<MirScalarExpr>, usize)>>, TransformError> { |
| 1019 | let mut orderer = Orderer::new( |
| 1020 | equivalences, |
| 1021 | available, |
| 1022 | unique_keys, |
| 1023 | cardinalities, |
| 1024 | filters, |
| 1025 | input_mapper, |
| 1026 | enable_join_prioritize_arranged, |
| 1027 | ); |
| 1028 | (0..available.len()) |
| 1029 | .map(move |i| orderer.optimize_order_for(i)) |
| 1030 | .collect::<Result<Vec<_>, _>>() |
| 1031 | } |
| 1032 | |
| 1033 | struct Orderer<'a> { |
| 1034 | inputs: usize, |
no test coverage detected