Function mz_transform::redundant_join::find_redundancy

source ยท
fn find_redundancy(
    input: usize,
    keys: &[Vec<usize>],
    input_mapper: &JoinInputMapper,
    equivalences: &[Vec<MirScalarExpr>],
    input_provs: &[Vec<ProvInfo>],
) -> Option<Vec<MirScalarExpr>>
Expand description

Attempts to find column bindings that make input redundant.

This method attempts to determine that input may be redundant by searching the join structure for another relation other with provenance that contains some provenance of input, and keys for input that are equated by the join to the corresponding columns of other under their provenance. The input provenance must also have its exact bit set.

In these circumstances, the claim is that because the key columns are equated and determine non-key columns, any matches between input and other will neither introduce new information to other, nor restrict the rows of other, nor alter their multplicity.