Can we remove the other_rels_list parameter for make_rels_by_clause_joins

From: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Can we remove the other_rels_list parameter for make_rels_by_clause_joins
Date: 2020-04-30 04:01:38
Message-ID: CAKU4AWpJoLVLgfCWw7o6ZP3bWaaCwk2y2O6D_w9t0=Hx7o398A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
v1-0001-Remove-other_rels_list-from-make_rels_by_clause_j.patch application/octet-stream 3.6 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan S. Katz 2020-04-30 04:12:48 Re: Poll: are people okay with function/operator table redesign?
Previous Message Andrew Gierth 2020-04-30 03:37:24 Re: Bug with subqueries in recursive CTEs?