Re: Optimizer docs typos

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: etsuro(dot)fujita(at)gmail(dot)com
Cc: guofenglinux(at)gmail(dot)com, magnus(at)hagander(dot)net, daniel(at)yesql(dot)se, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Optimizer docs typos
Date: 2020-05-21 02:25:35
Message-ID: 20200521.112535.2157720149461404932.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Wed, 20 May 2020 19:17:48 +0900, Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> wrote in
> On Tue, May 19, 2020 at 7:35 PM Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com> wrote:
> > On Mon, May 18, 2020 at 7:45 PM Richard Guo <guofenglinux(at)gmail(dot)com> wrote:
> > > ---query_planner()
> > > +---query_planner()
> > > make list of base relations used in query
> > > split up the qual into restrictions (a=1) and joins (b=c)
> > > find qual clauses that enable merge and hash joins
> >
> > Yeah, you are right. Another one would be in the prefix to
> > standard_join_search(); I think it might be better to have six dashes,
> > rather than five, because standard_join_search() is called within
> > make_rel_from_joinlist().
>
> Here is a patch including the change I proposed. (Yet another thing I
> noticed is the indent spaces for join_search_one_level(): that
> function is called within standard_join_search(), so it would be
> better to have one extra space, for consistency with others (eg,
> set_base_rel_pathlists() called from make_one_rel()), but that would
> be too nitpicking.) This is more like an improvement, so I'll apply
> the patch to HEAD only, if no objestions.

The original proposal for query_planner looks fine.

The description for make_rel_from_joinlist() and that for
standard_join_search() are at the same indentation depth. And it is
also strange that seemingly there is no line for level-5
indentation. If we make standard_join_search() a 6th-hyphened level
item, indentation of the surrounding descriptions needs a fix.

----make_one_rel()
set_base_rel_pathlists()
find seqscan and all index paths for each base relation
find selectivity of columns used in joins
make_rel_from_joinlist()
hand off join subproblems to a plugin, GEQO, or standard_join_search()
------standard_join_search()
call join_search_one_level() for each level of join tree needed
join_search_one_level():
For each joinrel of the prior level, do make_rels_by_clause_joins()
if it has join clauses, or make_rels_by_clauseless_joins() if not.

Looking the description for make_rel_from_joinlist(), it seems to me
that the author is thinking that make_rel_from_joinlist() is mere the
distributor for join subproblems and isn't worth an indent level.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2020-05-21 02:31:37 Re: Parallel Seq Scan vs kernel read ahead
Previous Message Andy Fan 2020-05-21 01:40:58 Re: Subplan result caching