Re: [HACKERS] advanced partition matching algorithm for partition-wise join
amul sul <sulamul@gmail.com>
From: amul sul <sulamul@gmail.com>
To: Etsuro Fujita <etsuro.fujita@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>,
Thomas Munro <thomas.munro@gmail.com>, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>, Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com>, Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>,
Dmitry Dolgov <9erthalion6@gmail.com>, Antonin Houska <ah@cybertec.at>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2019-11-06T06:11:47Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Suppress unused-variable warning.
- 401418ca6a68 13.0 landed
-
Allow partitionwise joins in more cases.
- c8434d64ce03 13.0 landed
-
Avoid crash in partitionwise join planning under GEQO.
- 7ad6498fd5a6 12.0 cited
- d70c147fa217 11.3 cited
-
Disable support for partitionwise joins in problematic cases.
- 7cfdc77023ad 12.0 cited
-
Add plan_cache_mode setting
- f7cb2842bf47 12.0 cited
-
Add test for partitionwise join involving default partition.
- 4513d3a4be0b 12.0 cited
-
Revise API for partition_rbound_cmp/partition_rbound_datum_cmp.
- b0229235564f 11.0 landed
Attachments
- 0002-Few-more-tests-and-adjustments-v2.patch (application/octet-stream) patch v2-0002
- 001-Improve-partition-matching-for-partitionwise-joins-v26.patch (application/octet-stream) patch v26-0001
Attached is the rebase atop the latest master head(a9056cc637f).
On Tue, Nov 5, 2019 at 6:44 PM amul sul <sulamul@gmail.com> wrote:
>
>
> On Fri, Nov 1, 2019 at 3:58 PM Etsuro Fujita <etsuro.fujita@gmail.com>
> wrote:
>
>> On Thu, Oct 31, 2019 at 6:49 PM Etsuro Fujita <etsuro.fujita@gmail.com>
>> wrote:
>> > Attached is an updated version. If no objections, I'll merge this
>> > with the main patch [1].
>>
>> Done. Attached is a new version of the patch.
>>
>> Other changes: in generate_matching_part_pairs(), I changed variable
>> names to match other functions, simplified assertions, and
>> adjusted/added comments a bit.
>>
>
> Thanks for the update version.
>
> A query and comments for v25:
>
> 583 + * The function returns NULL if we can not find the matching pair of
> 584 + * partitions. This happens if 1. multiple partitions on one side
> match with
> 585 + * one partition on the other side. 2. a given partition on the
> outer side
> 586 + * doesn't have a matching partition on the inner side. We can not
> support the
> 587 + * first case since we don't have a way to represent multiple
> partitions as a
> 588 + * single relation (RelOptInfo) and then perform join using the
> ganged
> 589 + * relation. We can not support the second case since the missing
> inner
> 590 + * partition needs to be represented as an empty relation and we
> don't have a
> 591 + * way to introduce empty relation during join planning after
> creating paths
> 592 + * for all the base relations.
> 593 + */
> 594 +PartitionBoundInfo
> 595 +partition_bounds_merge(int partnatts,
>
> I think the second condition mention for partition_bounds_merge() looks
> outdated, do you think we should remove that or am I missing something
> here?
> ---
>
> 1768 +
> 1769 + /*
> 1770 + * If this is an outer join, the merged partition would act
> as the
> 1771 + * default partition of the join; record the index in
> *default_index
> 1772 + * if not done yet.
> 1773 + */
> 1774 + if (jointype == JOIN_LEFT || jointype == JOIN_ANTI ||
> 1775 + jointype == JOIN_FULL)
> 1776 + {
>
> As decided need to replace this list by IS_OUTER_JOIN(jointype).
> ---
>
> 2020 + if (jointype == JOIN_LEFT || jointype == JOIN_FULL ||
> 2021 + jointype == JOIN_ANTI)
> 2022 + {
>
> Same as the previous.
> ---
>
> I tried a coverage testing and tried to adjust & add a few tests to
> improved the
> code coverage for the v25 patch. Please have a look at the attached 0002 &
> also
> attach the coverage output with & without this patch, TWIMW.
>
> 0001 is the same v25 patch, reattaching to make CFbot happy.
>
> Regards,
> Amul
>
>