提交 4bf1d27f 编写于 作者: S Sambitesh Dash

Bump ORCA version

上级 c891c8ac
......@@ -19,4 +19,4 @@ params:
BLD_TARGETS:
OUTPUT_ARTIFACT_DIR: gpdb_artifacts
CONFIGURE_FLAGS:
ORCA_TAG: v3.63.0
ORCA_TAG: v3.64.0
......@@ -40,10 +40,10 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <string.h>
]],
[
return strncmp("3.63.", GPORCA_VERSION_STRING, 5);
return strncmp("3.64.", GPORCA_VERSION_STRING, 5);
])],
[AC_MSG_RESULT([[ok]])],
[AC_MSG_ERROR([Your ORCA version is expected to be 3.63.XXX])]
[AC_MSG_ERROR([Your ORCA version is expected to be 3.64.XXX])]
)
AC_LANG_POP([C++])
])# PGAC_CHECK_ORCA_VERSION
......
......@@ -14017,7 +14017,7 @@ int
main ()
{
return strncmp("3.63.", GPORCA_VERSION_STRING, 5);
return strncmp("3.64.", GPORCA_VERSION_STRING, 5);
;
return 0;
......@@ -14027,7 +14027,7 @@ if ac_fn_cxx_try_run "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
else
as_fn_error $? "Your ORCA version is expected to be 3.63.XXX" "$LINENO" 5
as_fn_error $? "Your ORCA version is expected to be 3.64.XXX" "$LINENO" 5
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
......
[requires]
orca/v3.63.0@gpdb/stable
orca/v3.64.0@gpdb/stable
[imports]
include, * -> build/include
......
......@@ -544,24 +544,21 @@ set enable_indexscan=on;
set enable_bitmapscan=off;
set enable_hashjoin=off;
explain select * from t, pt where tid = ptid and pt1 = 'hello0';
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..437.00 rows=1 width=50)
-> Hash Join (cost=0.00..437.00 rows=1 width=50)
Hash Cond: t.tid = pt.ptid
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=19)
Hash Key: t.tid
-> Seq Scan on t (cost=0.00..431.00 rows=1 width=19)
-> Hash (cost=6.00..6.00 rows=1 width=31)
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..6.00 rows=1 width=31)
Hash Key: pt.ptid
-> Sequence (cost=0.00..6.00 rows=1 width=31)
-> Partition Selector for pt (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 6 (out of 6)
-> Dynamic Index Scan on pt (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=31)
Index Cond: pt1 = 'hello0'::text
Optimizer: Pivotal Optimizer (GPORCA) version 2.73.0
(15 rows)
QUERY PLAN
--------------------------------------------------------------------------------------------------------------
Hash Join (cost=0.00..437.00 rows=1 width=50)
Hash Cond: (t.tid = pt.ptid)
-> Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=2 width=19)
-> Seq Scan on t (cost=0.00..431.00 rows=1 width=19)
-> Hash (cost=6.00..6.00 rows=1 width=31)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..6.00 rows=1 width=31)
-> Sequence (cost=0.00..6.00 rows=1 width=31)
-> Partition Selector for pt (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 6 (out of 6)
-> Dynamic Index Scan on pt (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=31)
Index Cond: (pt1 = 'hello0'::text)
Optimizer: Pivotal Optimizer (GPORCA) version 3.64.0
(12 rows)
select * from t, pt where tid = ptid and pt1 = 'hello0';
dist | tid | t1 | t2 | dist | pt1 | pt2 | pt3 | ptid
......
......@@ -10930,20 +10930,17 @@ FROM (SELECT *
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=0.00..1293.00 rows=1 width=8)
-> Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..1293.00 rows=1 width=8)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..1293.00 rows=1 width=8)
-> Aggregate (cost=0.00..1293.00 rows=1 width=8)
-> Append (cost=0.00..1293.00 rows=2 width=1)
-> Result (cost=0.00..862.00 rows=1 width=11)
-> Result (cost=0.00..862.00 rows=1 width=1)
-> Hash Left Join (cost=0.00..862.00 rows=1 width=3)
Hash Cond: tab_1.id::text = tab_2.id::text
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=5)
Hash Key: tab_1.id
-> Seq Scan on tab_1 (cost=0.00..431.00 rows=1 width=5)
Hash Cond: ((tab_1.id)::text = (tab_2.id)::text)
-> Seq Scan on tab_1 (cost=0.00..431.00 rows=1 width=5)
-> Hash (cost=431.00..431.00 rows=1 width=7)
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=7)
Hash Key: tab_2.id::text
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=7)
-> Seq Scan on tab_2 (cost=0.00..431.00 rows=1 width=7)
-> Result (cost=0.00..431.00 rows=1 width=16)
-> Result (cost=0.00..431.00 rows=1 width=1)
-> Seq Scan on tab_3 (cost=0.00..431.00 rows=1 width=8)
Optimizer: Pivotal Optimizer (GPORCA) version 2.70.2
(17 rows)
......
......@@ -27,31 +27,29 @@ WHERE tq.sym = tt.symbol AND
tt.event_ts < tq.end_ts
GROUP BY 1
ORDER BY 1 asc ;
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..878.21 rows=413 width=16)
Merge Key: (my_tt_agg_small.event_ts / 100000 / 5 * 5)
-> GroupAggregate (cost=0.00..878.19 rows=138 width=16)
Group By: (my_tt_agg_small.event_ts / 100000 / 5 * 5)
-> Sort (cost=0.00..878.19 rows=138 width=16)
Sort Key: (my_tt_agg_small.event_ts / 100000 / 5 * 5)
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..878.10 rows=138 width=16)
Hash Key: (my_tt_agg_small.event_ts / 100000 / 5 * 5)
-> Result (cost=0.00..878.09 rows=138 width=16)
-> HashAggregate (cost=0.00..878.09 rows=138 width=16)
Group By: my_tt_agg_small.event_ts / 100000 / 5 * 5
-> Result (cost=0.00..866.15 rows=94594 width=8)
-> Hash Join (cost=0.00..865.39 rows=94594 width=8)
Hash Cond: my_tq_agg_small.sym::bpchar = my_tt_agg_small.symbol
Join Filter: my_tt_agg_small.event_ts >= my_tq_agg_small.ets AND my_tt_agg_small.event_ts < my_tq_agg_small.end_ts
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.10 rows=676 width=20)
Hash Key: my_tq_agg_small.sym::bpchar
-> Seq Scan on my_tq_agg_small (cost=0.00..431.02 rows=676 width=20)
-> Hash (cost=431.01..431.01 rows=140 width=25)
-> Seq Scan on my_tt_agg_small (cost=0.00..431.01 rows=140 width=25)
Settings: optimizer=on; optimizer_nestloop_factor=1
Optimizer status: Pivotal Optimizer (GPORCA) version 2.32.0
(22 rows)
QUERY PLAN
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..878.47 rows=413 width=16)
Merge Key: ((((my_tt_agg_small.event_ts / 100000) / 5) * 5))
-> GroupAggregate (cost=0.00..878.44 rows=138 width=16)
Group Key: ((((my_tt_agg_small.event_ts / 100000) / 5) * 5))
-> Sort (cost=0.00..878.44 rows=138 width=16)
Sort Key: ((((my_tt_agg_small.event_ts / 100000) / 5) * 5))
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..878.35 rows=138 width=16)
Hash Key: ((((my_tt_agg_small.event_ts / 100000) / 5) * 5))
-> Result (cost=0.00..878.34 rows=138 width=16)
-> HashAggregate (cost=0.00..878.34 rows=138 width=16)
Group Key: (((my_tt_agg_small.event_ts / 100000) / 5) * 5)
-> Result (cost=0.00..866.40 rows=94594 width=8)
-> Hash Join (cost=0.00..865.64 rows=94594 width=8)
Hash Cond: ((my_tq_agg_small.sym)::text = (my_tt_agg_small.symbol)::text)
Join Filter: ((my_tt_agg_small.event_ts >= my_tq_agg_small.ets) AND (my_tt_agg_small.event_ts < my_tq_agg_small.end_ts))
-> Seq Scan on my_tq_agg_small (cost=0.00..431.02 rows=676 width=20)
-> Hash (cost=431.30..431.30 rows=420 width=25)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.30 rows=420 width=25)
-> Seq Scan on my_tt_agg_small (cost=0.00..431.01 rows=140 width=25)
Optimizer: Pivotal Optimizer (GPORCA) version 3.64.0
(20 rows)
SELECT (tt.event_ts / 100000) / 5 * 5 as fivemin, COUNT(*)
......
......@@ -107,20 +107,17 @@ explain select count(*) from t1,t2 where t1.x = 100 and t1.x = t2.x;
QUERY PLAN
------------------------------------------------------------------------------------------------------------
Aggregate (cost=0.00..862.00 rows=1 width=8)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..862.00 rows=1 width=8)
-> Aggregate (cost=0.00..862.00 rows=1 width=8)
-> Hash Join (cost=0.00..862.00 rows=1 width=1)
Hash Cond: t1.x = t2.x
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=4)
Hash Key: t1.x
-> Seq Scan on t1 (cost=0.00..431.00 rows=1 width=4)
Filter: x = 100
-> Hash (cost=431.00..431.00 rows=1 width=4)
-> Seq Scan on t2 (cost=0.00..431.00 rows=1 width=4)
Filter: x = 100
Settings: optimizer=on
Optimizer status: Pivotal Optimizer (GPORCA) version 2.39.2
(14 rows)
-> Hash Join (cost=0.00..862.00 rows=1 width=1)
Hash Cond: (t1.x = t2.x)
-> Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=4)
-> Seq Scan on t1 (cost=0.00..431.00 rows=1 width=4)
Filter: (x = 100)
-> Hash (cost=431.00..431.00 rows=1 width=4)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=4)
-> Seq Scan on t2 (cost=0.00..431.00 rows=1 width=4)
Filter: (x = 100)
Optimizer: Pivotal Optimizer (GPORCA) version 3.64.0
(11 rows)
select count(*) from t1,t2 where t1.x = 100 and t1.x = t2.x;
count
......@@ -156,24 +153,20 @@ select * from t1,t2 where t1.x = 100 and t2.x >= t1.x;
--
set optimizer_segments=2;
explain select * from t1,t2 where t1.x = 100 and t1.x = t2.y and t1.x <= t2.x;
QUERY PLAN
-------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..862.01 rows=1 width=24)
-> Hash Join (cost=0.00..862.01 rows=1 width=24)
Hash Cond: t1.x = t2.y
Join Filter: t1.x <= t2.x
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=12)
Hash Key: t1.x
-> Seq Scan on t1 (cost=0.00..431.00 rows=1 width=12)
Filter: x = 100
-> Hash (cost=431.00..431.00 rows=1 width=12)
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=12)
Hash Key: t2.y
-> Seq Scan on t2 (cost=0.00..431.00 rows=1 width=12)
Filter: y = 100
Settings: optimizer=on; optimizer_segments=2
Optimizer status: Pivotal Optimizer (GPORCA) version 2.39.2
(15 rows)
QUERY PLAN
-------------------------------------------------------------------------------------------
Hash Join (cost=0.00..862.01 rows=1 width=24)
Hash Cond: (t1.x = t2.y)
Join Filter: (t1.x <= t2.x)
-> Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=12)
-> Seq Scan on t1 (cost=0.00..431.00 rows=1 width=12)
Filter: (x = 100)
-> Hash (cost=431.00..431.00 rows=1 width=12)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=12)
-> Seq Scan on t2 (cost=0.00..431.00 rows=1 width=12)
Filter: (y = 100)
Optimizer: Pivotal Optimizer (GPORCA) version 3.64.0
(11 rows)
reset optimizer_segments;
select * from t1,t2 where t1.x = 100 and t1.x = t2.y and t1.x <= t2.x;
......
......@@ -718,31 +718,31 @@ select * from csq_pullup t0 where 1= (select count(*) from csq_pullup t1 where t
-- numeric, numeric
--
explain select * from csq_pullup t0 where 1= (select count(*) from csq_pullup t1 where t0.n=t1.n);
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..862.00 rows=1 width=17)
-> Result (cost=0.00..862.00 rows=1 width=17)
Filter: 1 = COALESCE((count((count()))), 0::bigint)
-> Result (cost=0.00..862.00 rows=1 width=36)
-> Hash Left Join (cost=0.00..862.00 rows=1 width=25)
Hash Cond: csq_pullup.n = csq_pullup_1.n
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=17)
Hash Key: csq_pullup.n
-> Seq Scan on csq_pullup (cost=0.00..431.00 rows=1 width=17)
-> Hash (cost=431.00..431.00 rows=1 width=13)
-> GroupAggregate (cost=0.00..431.00 rows=1 width=13)
Group Key: csq_pullup_1.n
-> Sort (cost=0.00..431.00 rows=1 width=13)
Sort Key: csq_pullup_1.n
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=13)
Hash Key: csq_pullup_1.n
-> Result (cost=0.00..431.00 rows=1 width=13)
-> GroupAggregate (cost=0.00..431.00 rows=1 width=13)
Group Key: csq_pullup_1.n
-> Sort (cost=0.00..431.00 rows=1 width=5)
Sort Key: csq_pullup_1.n
-> Seq Scan on csq_pullup csq_pullup_1 (cost=0.00..431.00 rows=1 width=5)
Optimizer: Pivotal Optimizer (GPORCA) version 2.74.0
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------
Result (cost=0.00..862.00 rows=1 width=17)
Filter: (1 = COALESCE((count((count()))), 0::bigint))
-> Result (cost=0.00..862.00 rows=1 width=36)
-> Hash Left Join (cost=0.00..862.00 rows=1 width=25)
Hash Cond: (csq_pullup.n = csq_pullup_1.n)
-> Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=17)
-> Seq Scan on csq_pullup (cost=0.00..431.00 rows=1 width=17)
-> Hash (cost=431.00..431.00 rows=1 width=13)
-> Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..431.00 rows=1 width=13)
-> Result (cost=0.00..431.00 rows=1 width=13)
-> GroupAggregate (cost=0.00..431.00 rows=1 width=13)
Group Key: csq_pullup_1.n
-> Sort (cost=0.00..431.00 rows=1 width=13)
Sort Key: csq_pullup_1.n
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=13)
Hash Key: csq_pullup_1.n
-> Result (cost=0.00..431.00 rows=1 width=13)
-> GroupAggregate (cost=0.00..431.00 rows=1 width=13)
Group Key: csq_pullup_1.n
-> Sort (cost=0.00..431.00 rows=1 width=5)
Sort Key: csq_pullup_1.n
-> Seq Scan on csq_pullup csq_pullup_1 (cost=0.00..431.00 rows=1 width=5)
Optimizer: Pivotal Optimizer (GPORCA) version 3.64.0
(23 rows)
select * from csq_pullup t0 where 1= (select count(*) from csq_pullup t1 where t0.n=t1.n);
......@@ -1816,90 +1816,85 @@ SELECT * FROM dedup_test1 INNER JOIN dedup_test2 ON dedup_test1.a= dedup_test2.e
-- Test planner to check if it optimizes the join and marks it as a dummy join
EXPLAIN SELECT * FROM dedup_test3, dedup_test1 WHERE c = 7 AND dedup_test3.b IN (SELECT b FROM dedup_test1);
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice4; segments: 3) (cost=0.00..1324463.71 rows=4 width=20)
-> Hash Semi Join (cost=0.00..1324463.71 rows=2 width=20)
Hash Cond: dedup_test3.b = dedup_test1_1.b
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..1324032.71 rows=2 width=20)
Hash Key: dedup_test3.b
-> Nested Loop (cost=0.00..1324032.71 rows=2 width=20)
Join Filter: true
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=12)
-> Sequence (cost=0.00..431.00 rows=1 width=12)
-> Partition Selector for dedup_test3 (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 0 (out of 1)
-> Dynamic Seq Scan on dedup_test3 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=12)
Filter: c = 7
-> Seq Scan on dedup_test1 (cost=0.00..431.00 rows=2 width=8)
-> Hash (cost=431.00..431.00 rows=2 width=4)
-> Redistribute Motion 3:3 (slice3; segments: 3) (cost=0.00..431.00 rows=2 width=4)
Hash Key: dedup_test1_1.b
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..1324463.60 rows=4 width=20)
-> Hash Semi Join (cost=0.00..1324463.60 rows=2 width=20)
Hash Cond: (dedup_test3.b = dedup_test1_1.b)
-> Nested Loop (cost=0.00..1324032.60 rows=2 width=20)
Join Filter: true
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=12)
-> Sequence (cost=0.00..431.00 rows=1 width=12)
-> Partition Selector for dedup_test3 (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 0 (out of 1)
-> Dynamic Seq Scan on dedup_test3 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=12)
Filter: (c = 7)
-> Seq Scan on dedup_test1 (cost=0.00..431.00 rows=2 width=8)
-> Hash (cost=431.00..431.00 rows=4 width=4)
-> Broadcast Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=4 width=4)
-> Seq Scan on dedup_test1 dedup_test1_1 (cost=0.00..431.00 rows=2 width=4)
Optimizer: Pivotal Optimizer (GPORCA) version 2.74.0
(19 rows)
EXPLAIN SELECT * FROM dedup_test3, dedup_test1 WHERE c = 7 AND dedup_test3.b IN (SELECT a FROM dedup_test1);
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..1324463.71 rows=4 width=20)
-> Hash Semi Join (cost=0.00..1324463.71 rows=2 width=20)
Hash Cond: dedup_test3.b = dedup_test1_1.a
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..1324032.71 rows=2 width=20)
Hash Key: dedup_test3.b
-> Nested Loop (cost=0.00..1324032.71 rows=2 width=20)
Join Filter: true
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=12)
-> Sequence (cost=0.00..431.00 rows=1 width=12)
-> Partition Selector for dedup_test3 (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 0 (out of 1)
-> Dynamic Seq Scan on dedup_test3 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=12)
Filter: c = 7
-> Seq Scan on dedup_test1 (cost=0.00..431.00 rows=2 width=8)
-> Hash (cost=431.00..431.00 rows=2 width=4)
-> Seq Scan on dedup_test1 dedup_test1_1 (cost=0.00..431.00 rows=2 width=4)
Optimizer: Pivotal Optimizer (GPORCA) version 2.74.0
(17 rows)
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..1324463.60 rows=4 width=20)
-> Hash Semi Join (cost=0.00..1324463.60 rows=2 width=20)
Hash Cond: (dedup_test3.b = dedup_test1_1.a)
-> Nested Loop (cost=0.00..1324032.60 rows=2 width=20)
Join Filter: true
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=12)
-> Sequence (cost=0.00..431.00 rows=1 width=12)
-> Partition Selector for dedup_test3 (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 0 (out of 1)
-> Dynamic Seq Scan on dedup_test3 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=12)
Filter: (c = 7)
-> Seq Scan on dedup_test1 (cost=0.00..431.00 rows=2 width=8)
-> Hash (cost=431.00..431.00 rows=4 width=4)
-> Broadcast Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=4 width=4)
-> Seq Scan on dedup_test1 dedup_test1_1 (cost=0.00..431.00 rows=2 width=4)
Optimizer: Pivotal Optimizer (GPORCA) version 3.64.0
(16 rows)
EXPLAIN SELECT * FROM dedup_test3, dedup_test1 WHERE c = 7 AND EXISTS (SELECT b FROM dedup_test1) AND dedup_test3.b IN (SELECT b FROM dedup_test1);
QUERY PLAN
-----------------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice6; segments: 3) (cost=0.00..2648064.92 rows=4 width=20)
-> Hash Join (cost=0.00..2648064.92 rows=2 width=20)
Hash Cond: dedup_test3.b = dedup_test1_2.b
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..1324032.71 rows=2 width=20)
Hash Key: dedup_test3.b
-> Nested Loop (cost=0.00..1324032.71 rows=2 width=20)
Join Filter: true
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=12)
-> Sequence (cost=0.00..431.00 rows=1 width=12)
-> Partition Selector for dedup_test3 (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 0 (out of 1)
-> Dynamic Seq Scan on dedup_test3 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=12)
Filter: c = 7
-> Seq Scan on dedup_test1 (cost=0.00..431.00 rows=2 width=8)
-> Hash (cost=1324032.22..1324032.22 rows=2 width=4)
-> Nested Loop Semi Join (cost=0.00..1324032.22 rows=2 width=4)
Join Filter: true
-> GroupAggregate (cost=0.00..431.00 rows=2 width=4)
Group Key: dedup_test1_2.b
-> Sort (cost=0.00..431.00 rows=2 width=4)
Sort Key: dedup_test1_2.b
-> Redistribute Motion 3:3 (slice5; segments: 3) (cost=0.00..431.00 rows=2 width=4)
Hash Key: dedup_test1_2.b
-> GroupAggregate (cost=0.00..431.00 rows=2 width=4)
Group Key: dedup_test1_2.b
-> Sort (cost=0.00..431.00 rows=2 width=4)
Sort Key: dedup_test1_2.b
-> Seq Scan on dedup_test1 dedup_test1_2 (cost=0.00..431.00 rows=2 width=4)
-> Materialize (cost=0.00..431.00 rows=1 width=1)
-> Broadcast Motion 1:3 (slice4) (cost=0.00..431.00 rows=3 width=1)
-> Limit (cost=0.00..431.00 rows=1 width=1)
-> Gather Motion 3:1 (slice3; segments: 3) (cost=0.00..431.00 rows=1 width=1)
-> Limit (cost=0.00..431.00 rows=1 width=1)
-> Seq Scan on dedup_test1 dedup_test1_1 (cost=0.00..431.00 rows=2 width=1)
Optimizer: Pivotal Optimizer (GPORCA) version 2.74.0
(35 rows)
QUERY PLAN
---------------------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice6; segments: 3) (cost=0.00..2648064.82 rows=4 width=20)
-> Hash Join (cost=0.00..2648064.81 rows=2 width=20)
Hash Cond: (dedup_test3.b = dedup_test1_2.b)
-> Nested Loop (cost=0.00..1324032.60 rows=2 width=20)
Join Filter: true
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=12)
-> Sequence (cost=0.00..431.00 rows=1 width=12)
-> Partition Selector for dedup_test3 (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 0 (out of 1)
-> Dynamic Seq Scan on dedup_test3 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=12)
Filter: (c = 7)
-> Seq Scan on dedup_test1 (cost=0.00..431.00 rows=2 width=8)
-> Hash (cost=1324032.22..1324032.22 rows=4 width=4)
-> Broadcast Motion 3:3 (slice5; segments: 3) (cost=0.00..1324032.22 rows=4 width=4)
-> Nested Loop Semi Join (cost=0.00..1324032.22 rows=2 width=4)
Join Filter: true
-> GroupAggregate (cost=0.00..431.00 rows=2 width=4)
Group Key: dedup_test1_2.b
-> Sort (cost=0.00..431.00 rows=2 width=4)
Sort Key: dedup_test1_2.b
-> Redistribute Motion 3:3 (slice4; segments: 3) (cost=0.00..431.00 rows=2 width=4)
Hash Key: dedup_test1_2.b
-> GroupAggregate (cost=0.00..431.00 rows=2 width=4)
Group Key: dedup_test1_2.b
-> Sort (cost=0.00..431.00 rows=2 width=4)
Sort Key: dedup_test1_2.b
-> Seq Scan on dedup_test1 dedup_test1_2 (cost=0.00..431.00 rows=2 width=4)
-> Materialize (cost=0.00..431.00 rows=1 width=1)
-> Broadcast Motion 1:3 (slice3) (cost=0.00..431.00 rows=3 width=1)
-> Limit (cost=0.00..431.00 rows=1 width=1)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=1)
-> Limit (cost=0.00..431.00 rows=1 width=1)
-> Seq Scan on dedup_test1 dedup_test1_1 (cost=0.00..431.00 rows=2 width=1)
Optimizer: Pivotal Optimizer (GPORCA) version 3.64.0
(34 rows)
-- start_ignore
DROP TABLE IF EXISTS dedup_test1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册