提交 1ae03e79 编写于 作者: H Hans Zeller

Bump ORCA version to 3.37 (from 3.35)

Also add a few more tests for unions to ICG.
上级 c6d277c1
......@@ -40,10 +40,10 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <string.h>
]],
[
return strncmp("3.35.", GPORCA_VERSION_STRING, 5);
return strncmp("3.37.", GPORCA_VERSION_STRING, 5);
])],
[AC_MSG_RESULT([[ok]])],
[AC_MSG_ERROR([Your ORCA version is expected to be 3.35.XXX])]
[AC_MSG_ERROR([Your ORCA version is expected to be 3.37.XXX])]
)
AC_LANG_POP([C++])
])# PGAC_CHECK_ORCA_VERSION
......
......@@ -13995,7 +13995,7 @@ int
main ()
{
return strncmp("3.35.", GPORCA_VERSION_STRING, 5);
return strncmp("3.37.", GPORCA_VERSION_STRING, 5);
;
return 0;
......@@ -14005,7 +14005,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.35.XXX" "$LINENO" 5
as_fn_error $? "Your ORCA version is expected to be 3.37.XXX" "$LINENO" 5
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
......
[requires]
orca/v3.35.0@gpdb/stable
orca/v3.37.0@gpdb/stable
[imports]
include, * -> build/include
......
......@@ -88,9 +88,9 @@ sync_tools: opt_write_test
ifeq "$(findstring aix,$(BLD_ARCH))" ""
ifeq "$(findstring sles,$(BLD_ARCH))" ""
LD_LIBRARY_PATH='' wget --no-check-certificate -q -O - https://github.com/greenplum-db/gporca/archive/v3.35.0.tar.gz | tar zxf - -C $(BLD_TOP)/ext/$(BLD_ARCH)
LD_LIBRARY_PATH='' wget --no-check-certificate -q -O - https://github.com/greenplum-db/gporca/archive/v3.37.0.tar.gz | tar zxf - -C $(BLD_TOP)/ext/$(BLD_ARCH)
else
LD_LIBRARY_PATH='' wget --no-check-certificate -q -O - https://github.com/greenplum-db/gporca/releases/download/v3.35.0/bin_orca_centos5_release.tar.gz | tar zxf - -C $(BLD_TOP)/ext/$(BLD_ARCH)
LD_LIBRARY_PATH='' wget --no-check-certificate -q -O - https://github.com/greenplum-db/gporca/releases/download/v3.37.0/bin_orca_centos5_release.tar.gz | tar zxf - -C $(BLD_TOP)/ext/$(BLD_ARCH)
endif
endif
......
......@@ -8271,14 +8271,13 @@ explain select * from orca.t_date where user_id=9;
-> Sequence (cost=0.00..437.00 rows=1 width=20)
-> Partition Selector for t_date (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 6 (out of 6)
-> Result (cost=0.00..437.00 rows=1 width=20)
-> Append (cost=0.00..437.00 rows=1 width=20)
-> Dynamic Index Scan on t_date (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=50)
Index Cond: user_id = 9::numeric
-> Dynamic Seq Scan on t_date t_date_1 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=50)
Filter: user_id = 9::numeric
Optimizer: Pivotal Optimizer (GPORCA) version 2.74.0
(11 rows)
-> Append (cost=0.00..437.00 rows=1 width=20)
-> Dynamic Index Scan on t_date (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=20)
Index Cond: (user_id = 9::numeric)
-> Dynamic Seq Scan on t_date t_date_1 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=20)
Filter: (user_id = 9::numeric)
Optimizer: Pivotal Optimizer (GPORCA) version 3.35.0
(10 rows)
select * from orca.t_date where user_id=9;
timest | user_id | tag1 | tag2
......@@ -8325,14 +8324,13 @@ explain select * from orca.t_text where user_id=9;
-> Sequence (cost=0.00..437.00 rows=1 width=20)
-> Partition Selector for t_text (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 3 (out of 3)
-> Result (cost=0.00..437.00 rows=1 width=20)
-> Append (cost=0.00..437.00 rows=1 width=20)
-> Dynamic Index Scan on t_text (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=50)
Index Cond: user_id = 9::numeric
-> Dynamic Seq Scan on t_text t_text_1 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=50)
Filter: user_id = 9::numeric
Optimizer: Pivotal Optimizer (GPORCA) version 2.74.0
(11 rows)
-> Append (cost=0.00..437.00 rows=1 width=20)
-> Dynamic Index Scan on t_text (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=20)
Index Cond: (user_id = 9::numeric)
-> Dynamic Seq Scan on t_text t_text_1 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=20)
Filter: (user_id = 9::numeric)
Optimizer: Pivotal Optimizer (GPORCA) version 3.35.0
(10 rows)
select * from orca.t_text where user_id=9;
timest | user_id | tag1 | tag2
......@@ -8434,14 +8432,13 @@ explain select * from orca.t_ceeval_ints where user_id=4;
-> Sequence (cost=0.00..437.00 rows=1 width=21)
-> Partition Selector for t_ceeval_ints (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 3 (out of 3)
-> Result (cost=0.00..437.00 rows=1 width=21)
-> Append (cost=0.00..437.00 rows=1 width=21)
-> Dynamic Index Scan on t_ceeval_ints (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=51)
Index Cond: user_id = 4::numeric
-> Dynamic Seq Scan on t_ceeval_ints t_ceeval_ints_1 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=51)
Filter: user_id = 4::numeric
Optimizer: Pivotal Optimizer (GPORCA) version 2.74.0
(11 rows)
-> Append (cost=0.00..437.00 rows=1 width=21)
-> Dynamic Index Scan on t_ceeval_ints (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=21)
Index Cond: (user_id = 4::numeric)
-> Dynamic Seq Scan on t_ceeval_ints t_ceeval_ints_1 (dynamic scan id: 1) (cost=0.00..431.00 rows=1 width=21)
Filter: (user_id = 4::numeric)
Optimizer: Pivotal Optimizer (GPORCA) version 3.35.0
(10 rows)
select * from orca.t_ceeval_ints where user_id=4;
user_id | category_id | tag1 | tag2
......@@ -10104,24 +10101,25 @@ ORDER BY 1 asc ;
-> Sequence (cost=0.00..874.01 rows=1 width=8)
-> Partition Selector for my_tq_agg_opt_part (dynamic scan id: 1) (cost=10.00..100.00 rows=34 width=4)
Partitions selected: 2 (out of 2)
-> Result (cost=0.00..874.01 rows=1 width=8)
-> Append (cost=0.00..874.01 rows=1 width=8)
-> Nested Loop (cost=0.00..437.00 rows=1 width=132)
Join Filter: true
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=62)
-> Shared Scan (share slice:id 1:0) (cost=0.00..431.00 rows=1 width=62)
-> Dynamic Index Scan on my_tq_agg_opt_part (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=70)
Index Cond: ets <= share0_ref2.event_ts AND end_ts > share0_ref2.event_ts
Filter: sym::bpchar = share0_ref2.symbol AND bid_price::numeric < share0_ref2.trade_price
-> Nested Loop (cost=0.00..437.00 rows=1 width=132)
Join Filter: true
-> Broadcast Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=62)
-> Shared Scan (share slice:id 2:0) (cost=0.00..431.00 rows=1 width=62)
-> Dynamic Index Scan on my_tq_agg_opt_part my_tq_agg_opt_part_1 (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=70)
Index Cond: ets <= share0_ref3.event_ts
Filter: sym::bpchar = share0_ref3.symbol AND bid_price::numeric < share0_ref3.trade_price AND share0_ref3.event_ts < end_ts
Optimizer: Pivotal Optimizer (GPORCA) version 2.74.0
(34 rows)
-> Append (cost=0.00..874.00 rows=1 width=8)
-> Nested Loop (cost=0.00..437.00 rows=1 width=8)
Join Filter: true
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..431.00 rows=1 width=24)
-> Result (cost=0.00..431.00 rows=1 width=24)
-> Shared Scan (share slice:id 1:0) (cost=0.00..431.00 rows=1 width=24)
-> Dynamic Index Scan on my_tq_agg_opt_part (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=1)
Index Cond: ((ets <= share0_ref2.event_ts) AND (end_ts > share0_ref2.event_ts))
Filter: (((sym)::bpchar = share0_ref2.symbol) AND (plusone(bid_price) < share0_ref2.trade_price))
-> Nested Loop (cost=0.00..437.00 rows=1 width=8)
Join Filter: true
-> Broadcast Motion 3:3 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=24)
-> Result (cost=0.00..431.00 rows=1 width=24)
-> Shared Scan (share slice:id 2:0) (cost=0.00..431.00 rows=1 width=24)
-> Dynamic Index Scan on my_tq_agg_opt_part my_tq_agg_opt_part_1 (dynamic scan id: 1) (cost=0.00..6.00 rows=1 width=1)
Index Cond: (ets <= share0_ref3.event_ts)
Filter: (((sym)::bpchar = share0_ref3.symbol) AND (plusone(bid_price) < share0_ref3.trade_price) AND (share0_ref3.event_ts < end_ts))
Optimizer: Pivotal Optimizer (GPORCA) version 3.35.0
(35 rows)
reset optimizer_segments;
reset optimizer_enable_constant_expression_evaluation;
......
......@@ -1927,9 +1927,54 @@ ORDER BY a;
5
(4 rows)
create table t1_ncols(a int, b int, c text, d date) distributed by (a);
create table t2_ncols(a smallint, b bigint, c varchar(20), d date) distributed by (c, b)
partition by range (a) (start (0) end (8) every (4));
NOTICE: CREATE TABLE will create partition "t2_ncols_1_prt_1" for table "t2_ncols"
NOTICE: CREATE TABLE will create partition "t2_ncols_1_prt_2" for table "t2_ncols"
create view v1_ncols(id, a, b, c, d) as select 1,* from t1_ncols union all select 2,* from t2_ncols;
insert into t1_ncols values (1, 11, 'one', '2001-01-01');
insert into t2_ncols values (2, 22, 'two', '2002-02-02');
insert into t2_ncols values (4, 44, 'four','2004-04-04');
select b from t1_ncols union all select a from t2_ncols;
b
----
4
2
11
(3 rows)
select a+100, b, d from t1_ncols union select b, a+200, d from t2_ncols order by 1;
?column? | b | d
----------+-----+------------
22 | 202 | 02-02-2002
44 | 204 | 04-04-2004
101 | 11 | 01-01-2001
(3 rows)
select c, a from v1_ncols;
c | a
------+---
one | 1
four | 4
two | 2
(3 rows)
with cte1(aa, b, c, d) as (select a*100, b, c, d from t1_ncols union select * from t2_ncols)
select x.aa/100 aaa, x.c, y.c from cte1 x join cte1 y on x.aa=y.aa;
aaa | c | c
-----+------+------
0 | two | two
0 | four | four
1 | one | one
(3 rows)
--
-- Clean up
--
DROP TABLE IF EXISTS T_a1 CASCADE;
DROP TABLE IF EXISTS T_b2 CASCADE;
DROP TABLE IF EXISTS T_random CASCADE;
DROP VIEW IF EXISTS v1_ncols CASCADE;
DROP TABLE IF EXISTS t1_ncols CASCADE;
DROP TABLE IF EXISTS t2_ncols CASCADE;
......@@ -540,6 +540,23 @@ UNION
(SELECT a FROM t2_setop EXCEPT SELECT a FROM t1_setop ORDER BY a)
ORDER BY a;
create table t1_ncols(a int, b int, c text, d date) distributed by (a);
create table t2_ncols(a smallint, b bigint, c varchar(20), d date) distributed by (c, b)
partition by range (a) (start (0) end (8) every (4));
create view v1_ncols(id, a, b, c, d) as select 1,* from t1_ncols union all select 2,* from t2_ncols;
insert into t1_ncols values (1, 11, 'one', '2001-01-01');
insert into t2_ncols values (2, 22, 'two', '2002-02-02');
insert into t2_ncols values (4, 44, 'four','2004-04-04');
select b from t1_ncols union all select a from t2_ncols;
select a+100, b, d from t1_ncols union select b, a+200, d from t2_ncols order by 1;
select c, a from v1_ncols;
with cte1(aa, b, c, d) as (select a*100, b, c, d from t1_ncols union select * from t2_ncols)
select x.aa/100 aaa, x.c, y.c from cte1 x join cte1 y on x.aa=y.aa;
--
-- Clean up
--
......@@ -547,3 +564,6 @@ ORDER BY a;
DROP TABLE IF EXISTS T_a1 CASCADE;
DROP TABLE IF EXISTS T_b2 CASCADE;
DROP TABLE IF EXISTS T_random CASCADE;
DROP VIEW IF EXISTS v1_ncols CASCADE;
DROP TABLE IF EXISTS t1_ncols CASCADE;
DROP TABLE IF EXISTS t2_ncols CASCADE;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册