Re: FailedAssertion on partprune
David Rowley <david.rowley@2ndquadrant.com>
From: David Rowley <david.rowley@2ndquadrant.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>,
Jaime Casanova <jaime.casanova@2ndquadrant.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2018-08-01T14:35:09Z
Lists: pgsql-hackers
Attachments
- remove_incorrect_partprune_assert.patch (application/octet-stream) patch
On 31 July 2018 at 11:25, Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > Not looking at the code right now either, but removing that assert and > then removing the TABLESAMPLE clause, the query returns identical > results with and without pruning, so maybe you're right. No time for > further looking now. I thought about this a bit more and it seems fine just to remove the Assert. The patch that's pending in [1] adds all the correct handling for subplans that don't belong in any partition hierarchy. That's not the case for Jaime's plan, but those sub-partitioned tables will be identified just like any other partition by the run-time pruning code and can be pruned in the same way. The attached patch removes the Assert, but I think it should be probably be done as part of [1]'s patch since that's also adding the code to handle subplans for tables that don't belong in the partition hierarchy. I also spent a bit of time trying to create a simple test case for this and I've discovered that it's really not very easy and I have doubts about how stable such a plan might be. > (SELECT 'Jaime' <> 'Jamie' COLLATE es_EC) Apologies. It was a finger auto-pilot malfunction. [1] https://www.postgresql.org/message-id/CAKJS1f_eYwHk2x0xX7qW42rV_GRsJGBMe3AqN9MYLRSs1S%2BCiA%40mail.gmail.com -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Remove bogus Assert in make_partitionedrel_pruneinfo().
- 69d0e7e6b81d 11.0 landed
- 59ef49d26d2f 12.0 landed
-
LLVMJIT: Adapt to API changes in gdb and perf support.
- 1b957e59b92d 11.0 cited
-
Rewrite the code that applies scan/join targets to paths.
- 11cf92f6e2e1 11.0 cited