Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Phil Florent <philflorent(at)hotmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian
Date: 2018-06-29 21:27:17
Message-ID: 20180629212717.7xzvlyrvrcwgikdi@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-Jun-27, David Rowley wrote:

> I've only just completed reading back through all the code and I think
> it's correct. I ended up changing add_paths_to_append_rel() so that
> instead of performing concatenation on partitioned_rels from two UNION
> ALL children, it creates a List of lists. I believe this list can
> only end up with a 2-level hierarchy of partitioned rels. I tested
> this and it seems to work as I expect, although I think I need to
> study the code a bit more to ensure it can't happen. I need to check
> if there's some cases where nested UNION ALLs cannot be flattened to
> have a single UNION ALL parent. Supporting this did cause me to have
> to check the List->type in a few places. I only saw one other place in
> the code where this is done, so I figured that meant it was okay.

Checking a node's ->type member is not idiomatic -- use IsA() for that.
(Strangely, we have IsIntegerList() but only for use within list.c.) But
do we rely on the ordering of these lists anywhere? I'm wondering why
it's not more sensible to use a bitmapset there (I guess for your
list-of-lists business you'd have a list of bms's).

I didn't look your patch much further.

Since Tom has been revamping this code lately, I think it's a good
idea to wait for his input.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2018-06-29 22:02:07 Re: Tips on committing
Previous Message Gavin Flower 2018-06-29 21:19:13 Re: POC: GROUP BY optimization