Re: Performance regression with PostgreSQL 11 and partitioning

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(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-08 14:20:45
Message-ID: CAFjFpRe80Liqne=NsvL=odvNno7ypY8V1A5NnMEhAuMeSLpB9Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 8, 2018 at 1:52 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote
>
> I'm still of the opinion that find_appinfos_by_relids() needs to be
> nuked from orbit. It has nothing to recommend it either from the
> standpoint of performance or that of intellectual coherency (or maybe
> that problem is just inadequate documentation). The places consuming
> its results are no better.

Here's patch with some comments added to find_appinfos_by_relid(),
adjust_appendrel_attrs and ajust_appendrel_attrs_context. There was no
explanation about AppendRelInfo argument to adjust_appendrel_attrs or
its context in pre-v11 code. May be that was implicit in the first
paragraph. But then that implicit-ness holds true for AppendRelInfo
array as well. So, it was not changed when we changed the signature of
ajdust_appendrel_attrs().

>
> I was also pretty unhappy to discover, as I poked around in the code, that
> recent partitioning patches have introduced various assumptions about the
> ordering of the append_rel_list. It's bad enough that those exist at all;
> it's worse that they're documented, if at all, only beside the code that
> will fail (usually silently) if they're violated.

Not silently exactly; a build with assert would trip the assertion in
inheritance_planner() at line 1295. So any changes to that assumption
would be caught by our regression first. I agree that is not so useful
in production, but it wouldn't go, thanks to our regression.

> I do not find this
> acceptable. If we cannot avoid these assumptions, they need to be
> documented more centrally, like in the relation.h block comment for struct
> AppendRelInfo.
>

Attached patch adds the assumption to the block you mention above. Please check.

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

Attachment Content-Type Size
pg_arl.patch application/octet-stream 2.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan S. Katz 2018-06-08 14:22:52 Re: Add PostgreSQL 11 to feature matrix page?
Previous Message Phil Florent 2018-06-08 14:10:45 Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian