Re: Internal error XX000 with enable_partition_pruning=on, pg 11 beta1 on Debian
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>, Tom Lane <tgl@sss.pgh.pa.us>, Phil Florent <philflorent@hotmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2018-06-29T21:27:17Z
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 →
-
Match RelOptInfos by relids not pointer equality.
- a3deecb1c9af 11.0 landed
- 11e22e486d8d 12.0 landed
-
Fix run-time partition pruning for appends with multiple source rels.
- 1b54e91faabf 11.0 landed
- 1c2cb2744bf3 12.0 landed
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