Skip to content

Commit

Permalink
Fix icw test cases generted from "ORCA support ext stats, Fix EPQ..."
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaqizho committed Jan 10, 2025
1 parent febbc5c commit 9c09f36
Show file tree
Hide file tree
Showing 12 changed files with 111 additions and 100 deletions.
26 changes: 14 additions & 12 deletions src/test/regress/expected/bfv_dml_optimizer.out
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,20 @@ select * from update_pk_test order by 1,2;
(1 row)

explain update update_pk_test set a = 5;
QUERY PLAN
----------------------------------------------------------------------------------------------------------------
Update on update_pk_test (cost=0.00..431.07 rows=1 width=1)
-> Result (cost=0.00..431.00 rows=1 width=26)
-> Sort (cost=0.00..431.00 rows=1 width=22)
Sort Key: (DMLAction)
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=22)
Hash Key: update_pk_test_1.a
-> Split (cost=0.00..431.00 rows=1 width=22)
-> Seq Scan on update_pk_test (cost=0.00..431.00 rows=1 width=18)
Optimizer: Pivotal Optimizer (GPORCA) version 3.83.0
(9 rows)
QUERY PLAN
-------------------------------------------------------------------------------------------------------------
Update on update_pk_test (cost=0.00..431.06 rows=1 width=1)
-> Result (cost=0.00..0.00 rows=0 width=0)
One-Time Filter: true
-> Result (cost=0.00..0.00 rows=0 width=0)
-> Sort (cost=0.00..431.00 rows=2 width=22)
Sort Key: (DMLAction)
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=2 width=22)
Hash Key: a
-> Split (cost=0.00..431.00 rows=1 width=22)
-> Seq Scan on update_pk_test (cost=0.00..431.00 rows=1 width=18)
Optimizer: Pivotal Optimizer (GPORCA)
(11 rows)

update update_pk_test set a = 5;
select * from update_pk_test order by 1,2;
Expand Down
1 change: 1 addition & 0 deletions src/test/regress/expected/gporca.out
Original file line number Diff line number Diff line change
Expand Up @@ -14640,4 +14640,5 @@ select * from conf;
---------

(1 row)

reset optimizer_trace_fallback;
22 changes: 13 additions & 9 deletions src/test/regress/expected/gporca_optimizer.out
Original file line number Diff line number Diff line change
Expand Up @@ -14486,15 +14486,16 @@ ON t1.tradingday = t2.tradingday;
-> Dynamic Index Scan on t_clientproductind2_pkey on t_clientproductind2
Index Cond: (((tradingday)::text >= '20190715'::text) AND ((tradingday)::text <= '20190715'::text) AND ((tradingday)::text = '20190715'::text))
Number of partitions to scan: 1
-> GroupAggregate
Group Key: t_clientinstrumentind2.tradingday
-> Sort
Sort Key: t_clientinstrumentind2.tradingday
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: t_clientinstrumentind2.tradingday
-> Dynamic Index Scan on t_clientinstrumentind2_pkey on t_clientinstrumentind2
Index Cond: ((tradingday >= '20190715'::text) AND (tradingday <= '20190715'::text) AND (tradingday = '20190715'::text))
Number of partitions to scan: 1
-> Materialize
-> GroupAggregate
Group Key: t_clientinstrumentind2.tradingday
-> Sort
Sort Key: t_clientinstrumentind2.tradingday
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: t_clientinstrumentind2.tradingday
-> Dynamic Index Scan on t_clientinstrumentind2_pkey on t_clientinstrumentind2
Index Cond: ((tradingday >= '20190715'::text) AND (tradingday <= '20190715'::text) AND (tradingday = '20190715'::text))
Number of partitions to scan: 1
Optimizer: Pivotal Optimizer (GPORCA)
(22 rows)

Expand All @@ -14511,6 +14512,8 @@ INNER JOIN (
WHERE t.tradingday BETWEEN'20190715'AND '20190715'
GROUP BY t.tradingday)t2
ON t1.tradingday = t2.tradingday;
INFO: GPORCA failed to produce a plan, falling back to planner
DETAIL: No plan has been computed for required properties
tradingday | ins_spaninsarbitrageratio | tradingday | prod_spaninsarbitrageratio
------------+---------------------------+------------+----------------------------
20190715 | 1 | 20190715 | 0.9233716475
Expand Down Expand Up @@ -14763,4 +14766,5 @@ select * from conf;
---------

(1 row)

reset optimizer_trace_fallback;
30 changes: 16 additions & 14 deletions src/test/regress/expected/join_optimizer.out
Original file line number Diff line number Diff line change
Expand Up @@ -3372,18 +3372,19 @@ select * from
tenk1 join int4_tbl on f1 = twothousand,
q1, q2
where q1 = thousand or q2 = thousand;
QUERY PLAN
--------------------------------------------------------------------------
QUERY PLAN
------------------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
-> Hash Join
Hash Cond: (tenk1.twothousand = int4_tbl.f1)
-> Nested Loop
Join Filter: true
-> Nested Loop
Join Filter: true
-> Result
-> Materialize
-> Result
-> Broadcast Motion 3:3 (slice2; segments: 3)
-> Nested Loop
Join Filter: true
-> Broadcast Motion 3:3 (slice3; segments: 3)
-> Seq Scan on q1
-> Seq Scan on q2
-> Bitmap Heap Scan on tenk1
Recheck Cond: ((thousand = q1.q1) OR (thousand = q2.q2))
-> BitmapOr
Expand All @@ -3395,7 +3396,7 @@ where q1 = thousand or q2 = thousand;
-> Broadcast Motion 3:3 (slice4; segments: 3)
-> Seq Scan on int4_tbl
Optimizer: Pivotal Optimizer (GPORCA)
(21 rows)
(22 rows)

explain (costs off)
select * from
Expand All @@ -3409,18 +3410,19 @@ where thousand = (q1 + q2);
Hash Cond: (tenk1.twothousand = int4_tbl.f1)
-> Nested Loop
Join Filter: true
-> Nested Loop
Join Filter: true
-> Result
-> Materialize
-> Result
-> Broadcast Motion 3:3 (slice2; segments: 3)
-> Nested Loop
Join Filter: true
-> Broadcast Motion 3:3 (slice3; segments: 3)
-> Seq Scan on q1
-> Seq Scan on q2
-> Index Scan using tenk1_thous_tenthous on tenk1
Index Cond: (thousand = (q1.q1 + q2.q2))
-> Hash
-> Broadcast Motion 3:3 (slice4; segments: 3)
-> Seq Scan on int4_tbl
Optimizer: Pivotal Optimizer (GPORCA)
(16 rows)
(17 rows)

--
-- test ability to generate a suitable plan for a star-schema query
Expand Down
32 changes: 16 additions & 16 deletions src/test/regress/expected/partition_join.out
Original file line number Diff line number Diff line change
Expand Up @@ -2693,7 +2693,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand All @@ -2707,7 +2707,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice4; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand All @@ -2721,7 +2721,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice6; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand Down Expand Up @@ -2962,7 +2962,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand All @@ -2976,7 +2976,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice4; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand All @@ -2990,7 +2990,7 @@ SELECT t1.* FROM prt1_adv t1 WHERE EXISTS (SELECT 1 FROM prt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice6; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand Down Expand Up @@ -3800,7 +3800,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand All @@ -3813,7 +3813,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice3; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand All @@ -3826,7 +3826,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice4; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand Down Expand Up @@ -4029,7 +4029,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand All @@ -4042,7 +4042,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice3; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand All @@ -4055,7 +4055,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice4; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand Down Expand Up @@ -4293,7 +4293,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand Down Expand Up @@ -4469,7 +4469,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand All @@ -4482,7 +4482,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice3; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand All @@ -4495,7 +4495,7 @@ SELECT t1.* FROM plt1_adv t1 WHERE EXISTS (SELECT 1 FROM plt2_adv t2 WHERE t1.a
-> Unique
Group Key: (RowIdExpr)
-> Sort
Sort Key (Distinct): (RowIdExpr)
Sort Key: (RowIdExpr)
-> Redistribute Motion 3:3 (slice4; segments: 3)
Hash Key: (RowIdExpr)
-> Hash Join
Expand Down
22 changes: 11 additions & 11 deletions src/test/regress/expected/partition_prune_optimizer.out
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,7 @@ explain (costs off) select * from coercepart where a = any ('{ab,bc}');
explain (costs off) select * from coercepart where a = any ('{ab,null}');
QUERY PLAN
---------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
Gather Motion 1:1 (slice1; segments: 1)
-> Dynamic Seq Scan on coercepart
Number of partitions to scan: 1
Filter: ((a)::text = ANY ('{ab,NULL}'::text[]))
Expand All @@ -1364,7 +1364,7 @@ explain (costs off) select * from coercepart where a = any (null::text[]);
explain (costs off) select * from coercepart where a = all ('{ab}');
QUERY PLAN
----------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
Gather Motion 1:1 (slice1; segments: 1)
-> Dynamic Seq Scan on coercepart
Number of partitions to scan: 1
Filter: ((a)::text = ALL ('{ab}'::text[]))
Expand All @@ -1384,7 +1384,7 @@ explain (costs off) select * from coercepart where a = all ('{ab,bc}');
explain (costs off) select * from coercepart where a = all ('{ab,null}');
QUERY PLAN
---------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
Gather Motion 1:1 (slice1; segments: 1)
-> Dynamic Seq Scan on coercepart
Number of partitions to scan: 1
Filter: ((a)::text = ALL ('{ab,NULL}'::text[]))
Expand Down Expand Up @@ -3994,16 +3994,16 @@ explain (costs off) select * from listp1 where a = 2;
(4 rows)

explain (costs off) update listp1 set a = 1 where a = 2;
QUERY PLAN
------------------------------------------------------------
QUERY PLAN
------------------------------------------------------------------
Update on listp1
-> Result
One-Time Filter: true
-> Result
-> Redistribute Motion 3:3 (slice1; segments: 3)
Hash Key: listp1_1.a
Hash Key: a
-> Split
-> Seq Scan on listp1 listp1_1
-> Seq Scan on listp1
Filter: (a = 2)
Optimizer: Pivotal Optimizer (GPORCA)
(10 rows)
Expand All @@ -4020,16 +4020,16 @@ explain (costs off) select * from listp1 where a = 2;
(4 rows)

explain (costs off) update listp1 set a = 1 where a = 2;
QUERY PLAN
------------------------------------------------------------
QUERY PLAN
------------------------------------------------------------------
Update on listp1
-> Result
One-Time Filter: true
-> Result
-> Redistribute Motion 3:3 (slice1; segments: 3)
Hash Key: listp1_1.a
Hash Key: a
-> Split
-> Seq Scan on listp1 listp1_1
-> Seq Scan on listp1
Filter: (a = 2)
Optimizer: Pivotal Optimizer (GPORCA)
(10 rows)
Expand Down
2 changes: 1 addition & 1 deletion src/test/regress/expected/qp_orca_fallback_optimizer.out
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ explain update constr_tab set a = 10;
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=2 width=30)
Hash Key: constr_tab_1.a
-> Split (cost=0.00..431.00 rows=1 width=30)
-> Seq Scan on constr_tab constr_tab_1 (cost=0.00..431.00 rows=1 width=26)
-> Seq Scan on constr_tab (cost=0.00..431.00 rows=1 width=26)
Optimizer: Pivotal Optimizer (GPORCA)
(9 rows)

Expand Down
2 changes: 1 addition & 1 deletion src/test/regress/expected/spgist_optimizer.out
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ explain (costs off)
select * from spgist_domain_tbl where f1 = 'fo';
QUERY PLAN
-------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
Gather Motion 1:1 (slice1; segments: 1)
-> Seq Scan on spgist_domain_tbl
Filter: ((f1)::text = 'fo'::text)
Optimizer: Pivotal Optimizer (GPORCA)
Expand Down
Loading

0 comments on commit 9c09f36

Please sign in to comment.