Re: Crash in partition-wise join involving dummy partitioned relation

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Crash in partition-wise join involving dummy partitioned relation
Date: 2018-02-06 04:02:10
Message-ID: CAFjFpRe9G0D51q8K8Pi=k6z8gAphqMj=Oafa3rfhLFAt-mAFGg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 6, 2018 at 4:04 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Mon, Feb 5, 2018 at 4:46 AM, Ashutosh Bapat
> <ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote:
>> Here's patch taking that approach.
>
> I rewrote the comment in relation.h like this, which I think is more clear:
>
> /*
> * Is given relation partitioned?
> *
> - * A join between two partitioned relations with same partitioning scheme
> - * without any matching partitions will not have any partition in it but will
> - * have partition scheme set. So a relation is deemed to be partitioned if it
> - * has a partitioning scheme, bounds and positive number of partitions.
> + * It's not enough to test whether rel->part_scheme is set, because it might
> + * be that the basic partitioning properties of the input relations matched
> + * but the partition bounds did not.
> + *
> + * We treat dummy relations as unpartitioned. We could alternatively
> + * treat them as partitioned, but it's not clear whether that's a useful thing
> + * to do.
> */

The comment says why it checks both bounds and part_scheme, but it
doesn't explain why we check nparts, part_rels etc. My patch had that
explanation. Or may be with these changes those checks are not needed.
Should we remove those?

Thanks for the commit.

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2018-02-06 04:20:39 Re: [HACKERS] MERGE SQL Statement for PG11
Previous Message Robert Haas 2018-02-06 03:57:08 Re: [HACKERS] [PATCH] Lockable views