Re: pgsql: Support partition pruning at execution time
David Rowley <david.rowley@2ndquadrant.com>
From: David Rowley <david.rowley@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>,
Alvaro Herrera <alvherre@alvh.no-ip.org>, pgsql-committers@lists.postgresql.org
Date: 2018-04-09T01:03:56Z
Lists: pgsql-hackers
On 9 April 2018 at 09:54, Tom Lane <tgl@sss.pgh.pa.us> wrote: > BTW, pademelon just exhibited a different instability in this test: > > *** /home/bfarm/bf-data/HEAD/pgsql.build/src/test/regress/expected/partition_prune.out Sun Apr 8 01:56:04 2018 > --- /home/bfarm/bf-data/HEAD/pgsql.build/src/test/regress/results/partition_prune.out Sun Apr 8 17:48:14 2018 > *************** > *** 1606,1612 **** > -> Partial Aggregate (actual rows=1 loops=3) > -> Parallel Append (actual rows=0 loops=3) > Subplans Removed: 6 > ! -> Parallel Seq Scan on ab_a2_b1 (actual rows=0 loops=1) > Filter: ((a >= $1) AND (a <= $2) AND (b < 4)) > -> Parallel Seq Scan on ab_a2_b2 (actual rows=0 loops=1) > Filter: ((a >= $1) AND (a <= $2) AND (b < 4)) > --- 1606,1612 ---- > -> Partial Aggregate (actual rows=1 loops=3) > -> Parallel Append (actual rows=0 loops=3) > Subplans Removed: 6 > ! -> Parallel Seq Scan on ab_a2_b1 (actual rows=0 loops=2) > Filter: ((a >= $1) AND (a <= $2) AND (b < 4)) > -> Parallel Seq Scan on ab_a2_b2 (actual rows=0 loops=1) > Filter: ((a >= $1) AND (a <= $2) AND (b < 4)) > Reading code it looks like a bug in choose_next_subplan_for_worker(): The following needs to be changed for this patch: /* Advance to next plan. */ pstate->pa_next_plan++; I'll think a bit harder about the best way to fix and submit a patch for it later. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
Commits
-
Update Append's idea of first_partial_plan
- b7e2cbc5b49f 11.0 landed
-
Fix IndexOnlyScan counter for heap fetches in parallel mode
- 15a8f8caad14 11.0 landed
-
Fix incorrect logic for choosing the next Parallel Append subplan
- 468abb8f7a69 11.0 landed
-
Minor comment updates
- d7a95f06a1a1 11.0 landed
-
Attempt to stabilize partition_prune test output.
- b47a86f5008f 11.0 landed
-
Support partition pruning at execution time
- 499be013de65 11.0 cited