William Bernbaum <[email protected]> writes:

> The attached patch adds a pass, add_semijoin_not_null_quals(),
> which runs before set_base_rel_sizes(), that walks
> root->join_info_list, and, for each semijoin whose
> righthand keys can be unique-ified, pushes an IS NOT NULL
> restriction down onto the key.

I'm by no means an expert on the planner, but the idea seems sound to
me, and on the surface the change looks sensible.  I have just a couple
of code nitpicks:

> +     ListCell   *lc;
> +
> +     foreach(lc, root->join_info_list)
> +     {
> +             SpecialJoinInfo *sjinfo = (SpecialJoinInfo *) lfirst(lc);

This should be foreach_node(SpecialJoinInfo, sjinfo, root->join_info_list).

> +             ListCell   *lc2;
[...]
> +             foreach(lc2, sjinfo->semi_rhs_exprs)
> +             {
> +                     Expr       *expr = (Expr *) lfirst(lc2);

And this should be foreach_node(Expr, expr, sjinfo->semi_rhs_exprs).

- ilmari


Reply via email to