提交 0a924bd6 编写于 作者: B Bhuvnesh Chaudhary 提交者: Sambitesh Dash

Revert "ICG updates for ORCA commit: "Include binary coercible casts for predicate inference""

This reverts commit dbece3da.

Performance regression observed for tpcds queries due to cardinality
misestimation. Impacted TPCDS queries 174, 111 and 104.
Signed-off-by: NSambitesh Dash <sdash@pivotal.io>
上级 35a07f42
......@@ -40,10 +40,10 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <string.h>
]],
[
return strncmp("3.18.", GPORCA_VERSION_STRING, 5);
return strncmp("3.19.", GPORCA_VERSION_STRING, 5);
])],
[AC_MSG_RESULT([[ok]])],
[AC_MSG_ERROR([Your ORCA version is expected to be 3.18.XXX])]
[AC_MSG_ERROR([Your ORCA version is expected to be 3.19.XXX])]
)
AC_LANG_POP([C++])
])# PGAC_CHECK_ORCA_VERSION
......
......@@ -13927,7 +13927,7 @@ int
main ()
{
return strncmp("3.18.", GPORCA_VERSION_STRING, 5);
return strncmp("3.19.", GPORCA_VERSION_STRING, 5);
;
return 0;
......@@ -13937,7 +13937,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.18.XXX" "$LINENO" 5
as_fn_error $? "Your ORCA version is expected to be 3.19.XXX" "$LINENO" 5
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
......
[requires]
orca/v3.18.0@gpdb/stable
orca/v3.19.0@gpdb/stable
[imports]
include, * -> build/include
......
......@@ -109,7 +109,7 @@ sync_tools: opt_write_test
-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.18.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.19.0/bin_orca_centos5_release.tar.gz | tar zxf - -C $(BLD_TOP)/ext/$(BLD_ARCH)
endif
clean_tools: opt_write_test
......
......@@ -495,27 +495,26 @@ ANALYZE test_join_card1;
ANALYZE test_join_card2;
ANALYZE test_join_card3;
EXPLAIN SELECT * FROM test_join_card1 t1, test_join_card2 t2, test_join_card3 t3 WHERE t1.b = t2.b and t3.b = t2.b;
QUERY PLAN
------------------------------------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice4; segments: 3) (cost=0.00..1298.38 rows=5999 width=22)
-> Hash Join (cost=0.00..1297.89 rows=2000 width=22)
Hash Cond: (((test_join_card1.b)::text = (test_join_card2.b)::text) AND ((test_join_card3.b)::text = (test_join_card2.b)::text))
-> Hash Join (cost=0.00..865.03 rows=3334 width=18)
Hash Cond: ((test_join_card1.b)::text = (test_join_card3.b)::text)
QUERY PLAN
---------------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice4; segments: 3) (cost=0.00..1297.58 rows=5999 width=22)
-> Hash Join (cost=0.00..1297.09 rows=2000 width=22)
Hash Cond: ((test_join_card2.b)::text = (test_join_card3.b)::text)
-> Hash Join (cost=0.00..864.43 rows=2000 width=14)
Hash Cond: ((test_join_card1.b)::text = (test_join_card2.b)::text)
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..431.48 rows=6667 width=10)
Hash Key: test_join_card1.b
Hash Key: (test_join_card1.b)::text
-> Seq Scan on test_join_card1 (cost=0.00..431.15 rows=6667 width=10)
-> Hash (cost=431.20..431.20 rows=3334 width=8)
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..431.20 rows=3334 width=8)
Hash Key: (test_join_card3.b)::text
-> Seq Scan on test_join_card3 (cost=0.00..431.07 rows=3334 width=8)
-> Hash (cost=431.08..431.08 rows=2000 width=4)
-> Redistribute Motion 3:3 (slice3; segments: 3) (cost=0.00..431.08 rows=2000 width=4)
Hash Key: (test_join_card2.b)::text
-> Seq Scan on test_join_card2 (cost=0.00..431.04 rows=2000 width=4)
Planning time: 596.467 ms
Optimizer: PQO version 3.9.0
(18 rows)
-> Hash (cost=431.08..431.08 rows=2000 width=4)
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..431.08 rows=2000 width=4)
Hash Key: test_join_card2.b
-> Seq Scan on test_join_card2 (cost=0.00..431.04 rows=2000 width=4)
-> Hash (cost=431.20..431.20 rows=3334 width=8)
-> Redistribute Motion 3:3 (slice3; segments: 3) (cost=0.00..431.20 rows=3334 width=8)
Hash Key: (test_join_card3.b)::text
-> Seq Scan on test_join_card3 (cost=0.00..431.07 rows=3334 width=8)
Optimizer: PQO version 3.19.0
(17 rows)
-- start_ignore
DROP TABLE IF EXISTS test_join_card1;
......
......@@ -11010,96 +11010,3 @@ WITH abc AS (SELECT onetimefilter1.a, onetimefilter1.b FROM onetimefilter1, onet
1 | 0 | 10
(10 rows)
-- Test predicate inference for certain cast exprs
create table foid (a oid);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
create table infer_vc (a varchar);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
create table infer_txt (a text);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
CREATE TABLE infer_part_vc (id int, gender varchar(1))
DISTRIBUTED BY (id)
PARTITION BY LIST (gender)
( PARTITION girls VALUES ('F'),
PARTITION boys VALUES ('M'),
DEFAULT PARTITION other );
NOTICE: CREATE TABLE will create partition "infer_part_vc_1_prt_girls" for table "infer_part_vc"
NOTICE: CREATE TABLE will create partition "infer_part_vc_1_prt_boys" for table "infer_part_vc"
NOTICE: CREATE TABLE will create partition "infer_part_vc_1_prt_other" for table "infer_part_vc"
analyze foid;
analyze infer_txt;
analyze infer_vc;
analyze infer_part_vc;
explain select * from foid f1 inner join foid f2 on (f1.a = f2.a) where f2.a = 5;
QUERY PLAN
------------------------------------------------------------------------------------------------
Gather Motion 1:1 (slice1; segments: 1) (cost=10000000000.00..10000000002.01 rows=4 width=8)
-> Nested Loop (cost=10000000000.00..10000000002.01 rows=2 width=8)
-> Seq Scan on foid f1 (cost=0.00..1.00 rows=1 width=4)
Filter: (a = 5::oid)
-> Seq Scan on foid f2 (cost=0.00..1.00 rows=1 width=4)
Filter: (a = 5::oid)
Planning time: 0.776 ms
Optimizer: legacy query optimizer
(8 rows)
explain select * from infer_txt f1 inner join infer_txt f2 on (f1.a = f2.a) where f1.a = 'K';
QUERY PLAN
-------------------------------------------------------------------------------------------------
Gather Motion 1:1 (slice1; segments: 1) (cost=10000000000.00..10000000002.01 rows=4 width=64)
-> Nested Loop (cost=10000000000.00..10000000002.01 rows=2 width=64)
-> Seq Scan on infer_txt f1 (cost=0.00..1.00 rows=1 width=32)
Filter: (a = 'K'::text)
-> Seq Scan on infer_txt f2 (cost=0.00..1.00 rows=1 width=32)
Filter: (a = 'K'::text)
Planning time: 0.577 ms
Optimizer: legacy query optimizer
(8 rows)
explain select * from infer_vc f1 inner join infer_txt f2 on (f1.a = f2.a) where f1.a = 'K';
QUERY PLAN
-------------------------------------------------------------------------------------------------
Gather Motion 1:1 (slice1; segments: 1) (cost=10000000000.00..10000000002.01 rows=4 width=64)
-> Nested Loop (cost=10000000000.00..10000000002.01 rows=2 width=64)
-> Seq Scan on infer_vc f1 (cost=0.00..1.00 rows=1 width=32)
Filter: ((a)::text = 'K'::text)
-> Seq Scan on infer_txt f2 (cost=0.00..1.00 rows=1 width=32)
Filter: (a = 'K'::text)
Planning time: 0.622 ms
Optimizer: legacy query optimizer
(8 rows)
explain select * from infer_vc f1 inner join infer_vc f2 on (f1.a = f2.a) where f1.a = 'K';
QUERY PLAN
-------------------------------------------------------------------------------------------------
Gather Motion 1:1 (slice1; segments: 1) (cost=10000000000.00..10000000002.01 rows=4 width=64)
-> Nested Loop (cost=10000000000.00..10000000002.01 rows=2 width=64)
-> Seq Scan on infer_vc f1 (cost=0.00..1.00 rows=1 width=32)
Filter: ((a)::text = 'K'::text)
-> Seq Scan on infer_vc f2 (cost=0.00..1.00 rows=1 width=32)
Filter: ((a)::text = 'K'::text)
Planning time: 0.524 ms
Optimizer: legacy query optimizer
(8 rows)
explain select * from infer_part_vc inner join infer_txt on (infer_part_vc.gender = infer_txt.a) and infer_txt.a = 'M';
QUERY PLAN
--------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice2; segments: 3) (cost=10000000000.00..10000000004.06 rows=4 width=44)
-> Nested Loop (cost=10000000000.00..10000000004.06 rows=2 width=44)
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..2.04 rows=1 width=12)
Hash Key: infer_part_vc_1_prt_boys.gender
-> Append (cost=0.00..2.00 rows=1 width=12)
-> Seq Scan on infer_part_vc_1_prt_boys (cost=0.00..1.00 rows=1 width=12)
Filter: ((gender)::text = 'M'::text)
-> Seq Scan on infer_part_vc_1_prt_other (cost=0.00..1.00 rows=1 width=12)
Filter: ((gender)::text = 'M'::text)
-> Seq Scan on infer_txt (cost=0.00..1.00 rows=1 width=32)
Filter: (a = 'M'::text)
Planning time: 2.212 ms
Optimizer: legacy query optimizer
(13 rows)
......@@ -2047,28 +2047,6 @@ ANALYZE onetimefilter2;
EXPLAIN WITH abc AS (SELECT onetimefilter1.a, onetimefilter1.b FROM onetimefilter1, onetimefilter2 WHERE onetimefilter1.a=onetimefilter2.a) SELECT (SELECT 1 FROM abc WHERE f1.b = f2.b LIMIT 1), COALESCE((SELECT 2 FROM abc WHERE f1.a=random() AND f1.a=2), 0), (SELECT b FROM abc WHERE b=f1.b) FROM onetimefilter1 f1, onetimefilter2 f2 WHERE f1.b = f2.b;
WITH abc AS (SELECT onetimefilter1.a, onetimefilter1.b FROM onetimefilter1, onetimefilter2 WHERE onetimefilter1.a=onetimefilter2.a) SELECT (SELECT 1 FROM abc WHERE f1.b = f2.b LIMIT 1), COALESCE((SELECT 2 FROM abc WHERE f1.a=random() AND f1.a=2), 0), (SELECT b FROM abc WHERE b=f1.b) FROM onetimefilter1 f1, onetimefilter2 f2 WHERE f1.b = f2.b;
-- Test predicate inference for certain cast exprs
create table foid (a oid);
create table infer_vc (a varchar);
create table infer_txt (a text);
CREATE TABLE infer_part_vc (id int, gender varchar(1))
DISTRIBUTED BY (id)
PARTITION BY LIST (gender)
( PARTITION girls VALUES ('F'),
PARTITION boys VALUES ('M'),
DEFAULT PARTITION other );
analyze foid;
analyze infer_txt;
analyze infer_vc;
analyze infer_part_vc;
explain select * from foid f1 inner join foid f2 on (f1.a = f2.a) where f2.a = 5;
explain select * from infer_txt f1 inner join infer_txt f2 on (f1.a = f2.a) where f1.a = 'K';
explain select * from infer_vc f1 inner join infer_txt f2 on (f1.a = f2.a) where f1.a = 'K';
explain select * from infer_vc f1 inner join infer_vc f2 on (f1.a = f2.a) where f1.a = 'K';
explain select * from infer_part_vc inner join infer_txt on (infer_part_vc.gender = infer_txt.a) and infer_txt.a = 'M';
-- 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.
先完成此消息的编辑!
想要评论请 注册