fn derive_join_key(a: &Relation, b: &Relation) -> Vec<Var> {
    let b_vars_set: HashSet<Var> = b.0.iter().cloned().collect();

    // The join key is a vector of vars in both a and b, ordered as they are in a.
    a.0.iter()
        .filter(|var| b_vars_set.contains(&var))
        .cloned().collect()
}
/// The join key is a vector containing the vars in both relations a
/// and b, ordered as they are in relation a.
The join key is a vector containing the vars in both relations a
and b, ordered as they are in relation a.
The join key is a vector containing the vars in both relations a and b ordered as they are in relation a .
fn derive_join_key(a: &Relation, b: &Relation) -> Vec<Var> {
    let b_vars_set: HashSet<Var> = b.0.iter().cloned().collect();
    // The join key is a vector of vars in both a and b, ordered as they are in a.
    a.0.iter()
        .filter(|var| b_vars_set.contains(&var))
        .cloned().collect()
}
fn derive_join_key ( a : & Relation , b : & Relation ) -> Vec < Var > { let b_vars_set : HashSet < Var > = b . 0 . iter ( ) . cloned ( ) . collect ( ) ; // The join key is a vector of vars in both a and b, ordered as they are in a. a . 0 . iter ( ) . filter ( | var | b_vars_set . contains ( & var ) ) . cloned ( ) . collect ( ) }
The join key is a vector containing the vars in both relations a
and b, ordered as they are in relation a.
The join key is a vector containing the vars in both relations a and b ordered as they are in relation a .
a
&Relation
b
&Relation
a
&Relation
b
&Relation