提交 24049865 编写于 作者: H Hans Zeller 提交者: Shreedhar Hardikar

Bump ORCA version to 3.111.0, add test cases

The corresponding ORCA PR is https://github.com/greenplum-db/gporca/pull/605
上级 c54c7a91
......@@ -40,10 +40,10 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <string.h>
]],
[
return strncmp("3.110.", GPORCA_VERSION_STRING, 6);
return strncmp("3.111.", GPORCA_VERSION_STRING, 6);
])],
[AC_MSG_RESULT([[ok]])],
[AC_MSG_ERROR([Your ORCA version is expected to be 3.110.XXX])]
[AC_MSG_ERROR([Your ORCA version is expected to be 3.111.XXX])]
)
AC_LANG_POP([C++])
])# PGAC_CHECK_ORCA_VERSION
......
......@@ -12487,7 +12487,7 @@ int
main ()
{
return strncmp("3.110.", GPORCA_VERSION_STRING, 6);
return strncmp("3.111.", GPORCA_VERSION_STRING, 6);
;
return 0;
......@@ -12497,7 +12497,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.110.XXX" "$LINENO" 5
as_fn_error $? "Your ORCA version is expected to be 3.111.XXX" "$LINENO" 5
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
......
[requires]
orca/v3.110.0@gpdb/stable
orca/v3.111.0@gpdb/stable
[imports]
include, * -> build/include
......
......@@ -120,7 +120,7 @@ sync_tools: opt_write_test /opt/releng/apache-ant
-Divyrepo.user=$(IVYREPO_USER) -Divyrepo.passwd="$(IVYREPO_PASSWD)" -quiet resolve);
ifeq "$(findstring aix,$(BLD_ARCH))" ""
LD_LIBRARY_PATH='' wget --no-check-certificate -q -O - https://github.com/greenplum-db/gporca/releases/download/v3.110.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.111.0/bin_orca_centos5_release.tar.gz | tar zxf - -C $(BLD_TOP)/ext/$(BLD_ARCH)
endif
clean_tools: opt_write_test
......
......@@ -11873,3 +11873,39 @@ ERROR: Query requires a feature that has been disabled by a configuration setti
DETAIL: Could not devise a query plan for the given query.
HINT: Current settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
reset optimizer_join_order;
-- test selecting an outer ref from a scalar subquery, this will fall back to planner
-- expect 0 rows
SELECT 1
FROM tcorr1
WHERE tcorr1.a IS NULL OR
tcorr1.a = (SELECT tcorr1.a
FROM (SELECT rtrim(tcorr1.a::text) AS userid,
rtrim(tcorr1.b::text) AS part_pls
FROM tcorr2) al
WHERE 3 = tcorr1.a
);
?column?
----------
(0 rows)
-- expect 1 row, subquery returns a row, falls back in ORCA
select * from tcorr1 where b = (select tcorr1.b from tcorr2);
a | b
---+----
1 | 99
(1 row)
-- expect 0 rows, subquery returns no rows, falls back in ORCA
select * from tcorr1 where b = (select tcorr1.b from tcorr2 where b=33);
a | b
---+---
(0 rows)
-- expect 1 row, subquery returns nothing, so a < 22 is true, falls back in ORCA
select * from tcorr1 where a < coalesce((select tcorr1.a from tcorr2 where a = 11), 22);
a | b
---+----
1 | 99
(1 row)
reset optimizer_trace_fallback;
......@@ -11697,8 +11697,8 @@ where out.b in (select coalesce(tcorr2.a, 99)
-> Materialize (cost=0.00..431.00 rows=1 width=4)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=4)
-> Table Scan on tcorr2 (cost=0.00..431.00 rows=1 width=4)
Settings: optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: PQO version 3.107.0
Settings: optimizer=on; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: PQO version 3.109.0
(16 rows)
-- expect 1 row
......@@ -11731,8 +11731,8 @@ where out.b in (select max(tcorr2.b + out.b - 1)
-> Materialize (cost=0.00..431.00 rows=1 width=8)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=8)
-> Table Scan on tcorr2 (cost=0.00..431.00 rows=1 width=8)
Settings: optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: PQO version 3.107.0
Settings: optimizer=on; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: PQO version 3.109.0
(13 rows)
-- expect 1 row
......@@ -11776,8 +11776,8 @@ where out.b in (select coalesce(tcorr2_d.c, 99)
-> Materialize (cost=0.00..431.00 rows=1 width=8)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=8)
-> Table Scan on tcorr2 (cost=0.00..431.00 rows=1 width=8)
Settings: optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: PQO version 3.107.0
Settings: optimizer=on; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: PQO version 3.109.0
(22 rows)
-- expect 1 row
......@@ -11801,7 +11801,7 @@ where out.b in (select coalesce(tcorr2.a, 99)
INFO: GPORCA failed to produce a plan, falling back to planner
ERROR: Query requires a feature that has been disabled by a configuration setting.
DETAIL: Could not devise a query plan for the given query.
HINT: Current settings: optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
HINT: Current settings: optimizer=on; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
set optimizer_join_order to exhaustive2;
explain
select *
......@@ -11824,8 +11824,8 @@ where out.b in (select coalesce(tcorr2.a, 99)
-> Materialize (cost=0.00..431.00 rows=1 width=4)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=4)
-> Table Scan on tcorr2 (cost=0.00..431.00 rows=1 width=4)
Settings: optimizer_cte_inlining_bound=1000; optimizer_join_order=exhaustive2; optimizer_metadata_caching=on
Optimizer status: PQO version 3.107.0
Settings: optimizer=on; optimizer_cte_inlining_bound=1000; optimizer_join_order=exhaustive2; optimizer_metadata_caching=on
Optimizer status: PQO version 3.109.0
(16 rows)
-- expect 1 row
......@@ -11858,8 +11858,8 @@ where out.b in (select max(tcorr2.b + out.b - 1)
-> Materialize (cost=0.00..431.00 rows=1 width=8)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=8)
-> Table Scan on tcorr2 (cost=0.00..431.00 rows=1 width=8)
Settings: optimizer_cte_inlining_bound=1000; optimizer_join_order=exhaustive2; optimizer_metadata_caching=on
Optimizer status: PQO version 3.107.0
Settings: optimizer=on; optimizer_cte_inlining_bound=1000; optimizer_join_order=exhaustive2; optimizer_metadata_caching=on
Optimizer status: PQO version 3.109.0
(13 rows)
-- expect 1 row
......@@ -11903,8 +11903,8 @@ where out.b in (select coalesce(tcorr2_d.c, 99)
-> Materialize (cost=0.00..431.00 rows=1 width=8)
-> Gather Motion 3:1 (slice2; segments: 3) (cost=0.00..431.00 rows=1 width=8)
-> Table Scan on tcorr2 (cost=0.00..431.00 rows=1 width=8)
Settings: optimizer_cte_inlining_bound=1000; optimizer_join_order=exhaustive2; optimizer_metadata_caching=on
Optimizer status: PQO version 3.107.0
Settings: optimizer=on; optimizer_cte_inlining_bound=1000; optimizer_join_order=exhaustive2; optimizer_metadata_caching=on
Optimizer status: PQO version 3.109.0
(22 rows)
-- expect 1 row
......@@ -11928,5 +11928,45 @@ where out.b in (select coalesce(tcorr2.a, 99)
INFO: GPORCA failed to produce a plan, falling back to planner
ERROR: Query requires a feature that has been disabled by a configuration setting.
DETAIL: Could not devise a query plan for the given query.
HINT: Current settings: optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
HINT: Current settings: optimizer=on; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
reset optimizer_join_order;
-- test selecting an outer ref from a scalar subquery, this will fall back to planner
-- expect 0 rows
SELECT 1
FROM tcorr1
WHERE tcorr1.a IS NULL OR
tcorr1.a = (SELECT tcorr1.a
FROM (SELECT rtrim(tcorr1.a::text) AS userid,
rtrim(tcorr1.b::text) AS part_pls
FROM tcorr2) al
WHERE 3 = tcorr1.a
);
INFO: GPORCA failed to produce a plan, falling back to planner
?column?
----------
(0 rows)
-- expect 1 row, subquery returns a row, falls back in ORCA
select * from tcorr1 where b = (select tcorr1.b from tcorr2);
INFO: GPORCA failed to produce a plan, falling back to planner
a | b
---+----
1 | 99
(1 row)
-- expect 0 rows, subquery returns no rows, falls back in ORCA
select * from tcorr1 where b = (select tcorr1.b from tcorr2 where b=33);
INFO: GPORCA failed to produce a plan, falling back to planner
a | b
---+---
(0 rows)
-- expect 1 row, subquery returns nothing, so a < 22 is true, falls back in ORCA
select * from tcorr1 where a < coalesce((select tcorr1.a from tcorr2 where a = 11), 22);
INFO: GPORCA failed to produce a plan, falling back to planner
a | b
---+----
1 | 99
(1 row)
reset optimizer_trace_fallback;
......@@ -2050,6 +2050,29 @@ where out.b in (select coalesce(tcorr2.a, 99)
reset optimizer_join_order;
-- test selecting an outer ref from a scalar subquery, this will fall back to planner
-- expect 0 rows
SELECT 1
FROM tcorr1
WHERE tcorr1.a IS NULL OR
tcorr1.a = (SELECT tcorr1.a
FROM (SELECT rtrim(tcorr1.a::text) AS userid,
rtrim(tcorr1.b::text) AS part_pls
FROM tcorr2) al
WHERE 3 = tcorr1.a
);
-- expect 1 row, subquery returns a row, falls back in ORCA
select * from tcorr1 where b = (select tcorr1.b from tcorr2);
-- expect 0 rows, subquery returns no rows, falls back in ORCA
select * from tcorr1 where b = (select tcorr1.b from tcorr2 where b=33);
-- expect 1 row, subquery returns nothing, so a < 22 is true, falls back in ORCA
select * from tcorr1 where a < coalesce((select tcorr1.a from tcorr2 where a = 11), 22);
reset optimizer_trace_fallback;
-- start_ignore
DROP SCHEMA orca CASCADE;
-- end_ignore
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册