Hi Ilmari,

Thanks for the review - v2 attached.

> [use foreach_node for the loop over join_info_list]

Done.

> [and for the loop over semi_rhs_exprs]

This one I couldn't take as written, so I used foreach_ptr 
instead.

Two further changes:

First, I dropped this guard:

    /* Nothing reads the whole RHS unless it can be unique-ified */
    if (!sjinfo->semi_can_btree && !sjinfo->semi_can_hash)
        continue;

The check was unreachable. compute_semijoin_info() assigns
sjinfo->semi_rhs_exprs only after it has already returned early on 
!(all_btree || all_hash), so semi_rhs_exprs is NIL whenever both flags 
are false.

Second, I added a strictness check:

    /* A non-strict operator can match a NULL key */
    if (!op_strict(opno))
        continue;

compute_semijoin_info() requires each operator to be hashjoinable or
mergejoinable, but nothing requires it to be strict.

Thanks,
Will

Attachment: v2-0001-Skipping-NULL-keys-when-uniqueifying-a-semijoin-s.patch
Description: v2-0001-Skipping-NULL-keys-when-uniqueifying-a-semijoin-s.patch

Reply via email to