Re: Performance regression with PostgreSQL 11 and partitioning

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Thomas Reiss <thomas(dot)reiss(at)dalibo(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Performance regression with PostgreSQL 11 and partitioning
Date: 2018-06-11 06:33:47
Message-ID: CAFjFpRe8Wr=NNHuZkPHNCLzi=qj_7=6vgSyY5XFe4VN=yi9WQw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jun 9, 2018 at 12:22 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Fri, Jun 8, 2018 at 2:10 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> I don't understand this complaint. Before, the code took one
>>> AppendRelInfo, and according to you, it was clear what was supposed to
>>> happen. Now it takes an array of AppendRelInfos and, according to
>>> you, it's completely unclear. Yet that seems, to me at least, to be a
>>> straightforward generalization. If 1 AppendRelInfo is an adequate
>>> specification of one translations, why are N AppendRelInfos not an
>>> adequate specification of N translations?
>>
>> Because the relationships between the transforms are unclear. Are we
>> supposed to apply those N transformations to the expression in sequence?
>> It doesn't look to me like that's what the code does. I think --- I might
>> be wrong --- that the code is relying on the transformations to be
>> non-overlapping, that is a change made by any one of them cannot be
>> further affected by another one. This is, however, undocumented.
>
> OK, I see. I guess that possible confusion didn't occur to me both
> because I was looking at the code, which I knew wouldn't handle
> overlapping transformations, and also because the intended use was for
> partition-wise join, where the problem can't come up because we're
> translating from the toplevel RTIs for the join to the set of RTIs
> appropriate for one child-join. But, it's certainly fine to add a
> comment.

That didn't occurred to me as well.

Here's patch with comments and Assertions added to check the
non-overlapping AppendRelInfos. The assertions check that same parent
or child doesn't appear more than once in any of the AppendRelInfos,
neither as a parent nor as a child.

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

Attachment Content-Type Size
pg_arl_v2.patch application/octet-stream 4.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Antonin Houska 2018-06-11 07:07:47 Re: Fix slot's xmin advancement and subxact's lost snapshots in decoding.
Previous Message Hubert Zhang 2018-06-11 06:31:58 Secured and customizable PLPython and PLR on Postgresql