Can we remove the other_rels_list parameter for make_rels_by_clause_joins - Mailing list pgsql-hackers

From Andy Fan
Subject Can we remove the other_rels_list parameter for make_rels_by_clause_joins
Date
Msg-id CAKU4AWpJoLVLgfCWw7o6ZP3bWaaCwk2y2O6D_w9t0=Hx7o398A@mail.gmail.com
Whole thread Raw
List pgsql-hackers
Hi:
  For a given level for join_search_one_level,  it is always try to join every relation
in joinrel[level-1] to *initial_rels*.  but the current code doesn't show this directly. 

join_search_one_level

                        if (level == 2)         /* consider remaining initial rels */
                        {
                                other_rels_list = joinrels[level - 1];
                                other_rels = lnext(other_rels_list, r);
                        }
                        else                            /* consider all initial rels */
                        {
                                other_rels_list = joinrels[1];
                                other_rels = list_head(other_rels_list);
                        }

                        make_rels_by_clause_joins(root,
                                                                          old_rel,
                                                                          other_rels_list,
                                                                          other_rels);

I'd like to remove the parameter and use root->inital_rels directly.  I did the same
for make_rels_by_clauseless_joins.  The attached is my proposal which should be
semantic correctly and more explicitly. 

Best Regards
Andy Fan
Attachment

pgsql-hackers by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: Bug with subqueries in recursive CTEs?
Next
From: "Jonathan S. Katz"
Date:
Subject: Re: Poll: are people okay with function/operator table redesign?