@@ -3684,18 +3684,17 @@ create table listp_12_2 partition of listp_12 for values in(2);
36843684alter table listp_12_1 set (parallel_workers = 0);
36853685-- Ensure that listp_12_2 is not scanned. (The nested Append is not seen in
36863686-- the plan as it's pulled in setref.c due to having just a single subnode).
3687- explain (analyze on, costs off, timing off, summary off)
3688- select * from listp where a = (select 1);
3689- QUERY PLAN
3687+ select explain_parallel_append('select * from listp where a = (select 1);');
3688+ explain_parallel_append
36903689----------------------------------------------------------------------
3691- Gather (actual rows=0 loops=1 )
3690+ Gather (actual rows=N loops=N )
36923691 Workers Planned: 2
36933692 Params Evaluated: $0
3694- Workers Launched: 2
3693+ Workers Launched: N
36953694 InitPlan 1 (returns $0)
3696- -> Result (actual rows=1 loops=1 )
3697- -> Parallel Append (actual rows=0 loops=3 )
3698- -> Seq Scan on listp_12_1 listp_1 (actual rows=0 loops=1 )
3695+ -> Result (actual rows=N loops=N )
3696+ -> Parallel Append (actual rows=N loops=N )
3697+ -> Seq Scan on listp_12_1 listp_1 (actual rows=N loops=N )
36993698 Filter: (a = $0)
37003699 -> Parallel Seq Scan on listp_12_2 listp_2 (never executed)
37013700 Filter: (a = $0)
@@ -3704,34 +3703,34 @@ select * from listp where a = (select 1);
37043703-- Like the above but throw some more complexity at the planner by adding
37053704-- a UNION ALL. We expect both sides of the union not to scan the
37063705-- non-required partitions.
3707- explain (analyze on, costs off, timing off, summary off)
3708- select * from listp where a = (select 1)
3706+ select explain_parallel_append(
3707+ ' select * from listp where a = (select 1)
37093708 union all
3710- select * from listp where a = (select 2);
3711- QUERY PLAN
3709+ select * from listp where a = (select 2);');
3710+ explain_parallel_append
37123711-----------------------------------------------------------------------------------
3713- Append (actual rows=0 loops=1 )
3714- -> Gather (actual rows=0 loops=1 )
3712+ Append (actual rows=N loops=N )
3713+ -> Gather (actual rows=N loops=N )
37153714 Workers Planned: 2
37163715 Params Evaluated: $0
3717- Workers Launched: 2
3716+ Workers Launched: N
37183717 InitPlan 1 (returns $0)
3719- -> Result (actual rows=1 loops=1 )
3720- -> Parallel Append (actual rows=0 loops=3 )
3721- -> Seq Scan on listp_12_1 listp_1 (actual rows=0 loops=1 )
3718+ -> Result (actual rows=N loops=N )
3719+ -> Parallel Append (actual rows=N loops=N )
3720+ -> Seq Scan on listp_12_1 listp_1 (actual rows=N loops=N )
37223721 Filter: (a = $0)
37233722 -> Parallel Seq Scan on listp_12_2 listp_2 (never executed)
37243723 Filter: (a = $0)
3725- -> Gather (actual rows=0 loops=1 )
3724+ -> Gather (actual rows=N loops=N )
37263725 Workers Planned: 2
37273726 Params Evaluated: $1
3728- Workers Launched: 2
3727+ Workers Launched: N
37293728 InitPlan 2 (returns $1)
3730- -> Result (actual rows=1 loops=1 )
3731- -> Parallel Append (actual rows=0 loops=3 )
3729+ -> Result (actual rows=N loops=N )
3730+ -> Parallel Append (actual rows=N loops=N )
37323731 -> Seq Scan on listp_12_1 listp_4 (never executed)
37333732 Filter: (a = $1)
3734- -> Parallel Seq Scan on listp_12_2 listp_5 (actual rows=0 loops=1 )
3733+ -> Parallel Seq Scan on listp_12_2 listp_5 (actual rows=N loops=N )
37353734 Filter: (a = $1)
37363735(23 rows)
37373736
0 commit comments