Lists input columns whose values are used in outputs. You can use `BTreeSet::last()` to extract the maximum demanded column from the set. It is entirely appropriate to determine the demand of an instance and then both apply a projection to the subject of the instance and `self.permute` this instance.
(&self)
| 873 | /// and then both apply a projection to the subject of the instance and |
| 874 | /// `self.permute` this instance. |
| 875 | pub fn demand(&self) -> BTreeSet<usize> { |
| 876 | let mut demanded = BTreeSet::new(); |
| 877 | for (_index, pred) in self.predicates.iter() { |
| 878 | demanded.extend(pred.support()); |
| 879 | } |
| 880 | demanded.extend(self.projection.iter().cloned()); |
| 881 | for index in (0..self.expressions.len()).rev() { |
| 882 | if demanded.contains(&(self.input_arity + index)) { |
| 883 | demanded.extend(self.expressions[index].support()); |
| 884 | } |
| 885 | } |
| 886 | demanded.retain(|col| col < &self.input_arity); |
| 887 | demanded |
| 888 | } |
| 889 | |
| 890 | /// Update input column references, due to an input projection or permutation. |
| 891 | /// |
no test coverage detected