Re: [HACKERS] Proposal : Parallel Merge Join - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [HACKERS] Proposal : Parallel Merge Join
Date
Msg-id CA+TgmoZb5_yQ08sN3=uYqDZ7J+MsvzPOsAvEg1azr+5kwT2cAw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Proposal : Parallel Merge Join  (Dilip Kumar <dilipbalaut@gmail.com>)
Responses Re: [HACKERS] Proposal : Parallel Merge Join  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-hackers
On Tue, Mar 7, 2017 at 5:16 AM, Dilip Kumar <dilipbalaut@gmail.com> wrote:
> I am confused about whether to call
> "get_cheapest_parallel_safe_total_inner" with
> innerrel->cheapest_parameterized_paths like we do in case of
> hash_inner_and_outer or with
> innerrel->pathlist.  The reason behind I am calling this with complete
> pathlist (innerrel->pathlist) is that inside generate_mergejoin_paths
> it calls "get_cheapest_path_for_pathkeys" for complete pathlist and if
> we decide not to call consider_parallel_mergejoin if the cheapest
> parallel safe path in innerrel->cheapest_parameterized_paths is NULL
> then it will not be fair (we might have some parallel safe paths in
> innerrel->pathlist).

You're right to be confused, because that seems to be a bug in the
existing code.  There seems to be no guarantee that the cheapest
parallel-safe path will be in the cheapest_parameterized_paths list.
I'll go fix that.

As a matter of style, when testing a value of type "bool", write if
(x) or if (!x).  When testing a variable of some other type, say int,
write if (x == 0) or if (x != 0) or whatever.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Rafia Sabih
Date:
Subject: Re: [HACKERS] Enabling parallelism for queries coming from SQL orother PL functions
Next
From: Tomas Vondra
Date:
Subject: Re: [HACKERS] PATCH: two slab-like memory allocators