Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
67c79899
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
67c79899
编写于
3月 02, 2017
作者:
H
Heikki Linnakangas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move test for an old ORCA EXPLAIN bug to main test suite.
上级
4debd98c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
199 addition
and
84 deletion
+199
-84
src/test/regress/expected/gp_explain.out
src/test/regress/expected/gp_explain.out
+66
-2
src/test/regress/expected/gp_explain_optimizer.out
src/test/regress/expected/gp_explain_optimizer.out
+74
-2
src/test/regress/sql/gp_explain.sql
src/test/regress/sql/gp_explain.sql
+59
-2
src/test/tinc/tincrepo/query/indexapply/expected_bfv_other/mpp22263.ans
...tincrepo/query/indexapply/expected_bfv_other/mpp22263.ans
+0
-18
src/test/tinc/tincrepo/query/indexapply/sql_bfv_other/init_file
...st/tinc/tincrepo/query/indexapply/sql_bfv_other/init_file
+0
-6
src/test/tinc/tincrepo/query/indexapply/sql_bfv_other/mpp22263.sql
...tinc/tincrepo/query/indexapply/sql_bfv_other/mpp22263.sql
+0
-14
src/test/tinc/tincrepo/query/indexapply/sql_bfv_other/mpp22263_setup.sql
...increpo/query/indexapply/sql_bfv_other/mpp22263_setup.sql
+0
-22
src/test/tinc/tincrepo/query/indexapply/test_indexapply_bfv.py
...est/tinc/tincrepo/query/indexapply/test_indexapply_bfv.py
+0
-18
未找到文件。
src/test/regress/expected/gp_explain.out
浏览文件 @
67c79899
-- Helper function, to return the EXPLAIN
ANALYZE
output of a query as a normal
-- Helper function, to return the EXPLAIN output of a query as a normal
-- result set, so that you can manipulate it further.
create or replace function get_explain_output(explain_query text) returns setof text as
$$
declare
explainrow text;
begin
for explainrow in execute 'EXPLAIN ' || explain_query
loop
return next explainrow;
end loop;
end;
$$ language plpgsql;
-- Same, for EXPLAIN ANALYZE
create or replace function get_explain_analyze_output(explain_query text) returns setof text as
$$
declare
explainrow text;
begin
...
...
@@ -37,7 +49,7 @@ set explain_memory_verbosity='summary';
-- The plan should consist of a Gather and a Seq Scan, with a
-- "Memory: ..." line on both nodes.
SELECT COUNT(*) from
get_explain_output($$
get_explain_
analyze_
output($$
SELECT * FROM explaintest;
$$) as et
WHERE et like '%Memory: %';
...
...
@@ -46,3 +58,55 @@ WHERE et like '%Memory: %';
2
(1 row)
reset explain_memory_verbosity;
-- Verify that the column references are OK. This tests for an old ORCA bug,
-- where the Filter clause in the IndexScan of this query was incorrectly
-- printed as something like:
--
-- Filter: "outer".column2 = mpp22263.*::text
CREATE TABLE mpp22263 (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 name,
stringu2 name,
string4 name
) distributed by (unique1);
create index mpp22263_idx1 on mpp22263 using btree(unique1);
explain
select * from mpp22263, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j)
WHERE mpp22263.unique1 = v.i and mpp22263.stringu1 = v.j;
QUERY PLAN
-----------------------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3) (cost=0.06..278.70 rows=14 width=280)
-> Hash Join (cost=0.06..278.70 rows=5 width=280)
Hash Cond: mpp22263.unique1 = "*VALUES*".column1 AND mpp22263.stringu1::text = "*VALUES*".column2
-> Seq Scan on mpp22263 (cost=0.00..219.00 rows=3967 width=244)
-> Hash (cost=0.03..0.03 rows=1 width=36)
-> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=1 width=36)
Optimizer status: legacy query optimizer
(7 rows)
-- atmsort.pm masks out differences in the Filter line, so just memorizing
-- the output of the above EXPLAIN isn't enough to catch a faulty Filter line.
-- Extract the Filter explicitly.
SELECT * from
get_explain_output($$
select * from mpp22263, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j)
WHERE mpp22263.unique1 = v.i and mpp22263.stringu1 = v.j;
$$) as et
WHERE et like '%Filter: %';
et
----
(0 rows)
src/test/regress/expected/gp_explain_optimizer.out
浏览文件 @
67c79899
-- Helper function, to return the EXPLAIN
ANALYZE
output of a query as a normal
-- Helper function, to return the EXPLAIN output of a query as a normal
-- result set, so that you can manipulate it further.
create or replace function get_explain_output(explain_query text) returns setof text as
$$
declare
explainrow text;
begin
for explainrow in execute 'EXPLAIN ' || explain_query
loop
return next explainrow;
end loop;
end;
$$ language plpgsql;
-- Same, for EXPLAIN ANALYZE
create or replace function get_explain_analyze_output(explain_query text) returns setof text as
$$
declare
explainrow text;
begin
...
...
@@ -39,7 +51,7 @@ set explain_memory_verbosity='summary';
-- The plan should consist of a Gather and a Seq Scan, with a
-- "Memory: ..." line on both nodes.
SELECT COUNT(*) from
get_explain_output($$
get_explain_
analyze_
output($$
SELECT * FROM explaintest;
$$) as et
WHERE et like '%Memory: %';
...
...
@@ -48,3 +60,63 @@ WHERE et like '%Memory: %';
2
(1 row)
reset explain_memory_verbosity;
-- Verify that the column references are OK. This tests for an old ORCA bug,
-- where the Filter clause in the IndexScan of this query was incorrectly
-- printed as something like:
--
-- Filter: "outer".column2 = mpp22263.*::text
CREATE TABLE mpp22263 (
unique1 int4,
unique2 int4,
two int4,
four int4,
ten int4,
twenty int4,
hundred int4,
thousand int4,
twothousand int4,
fivethous int4,
tenthous int4,
odd int4,
even int4,
stringu1 name,
stringu2 name,
string4 name
) distributed by (unique1);
create index mpp22263_idx1 on mpp22263 using btree(unique1);
explain
select * from mpp22263, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j)
WHERE mpp22263.unique1 = v.i and mpp22263.stringu1 = v.j;
QUERY PLAN
--------------------------------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..2.00 rows=1 width=256)
-> Nested Loop (cost=0.00..2.00 rows=1 width=256)
Join Filter: true
-> Append (cost=0.00..0.00 rows=1 width=12)
-> Result (cost=0.00..0.00 rows=1 width=12)
-> Result (cost=0.00..0.00 rows=1 width=12)
-> Result (cost=0.00..0.00 rows=1 width=12)
-> Result (cost=0.00..0.00 rows=1 width=12)
-> Index Scan using mpp22263_idx1 on mpp22263 (cost=0.00..2.00 rows=1 width=244)
Index Cond: mpp22263.unique1 = (147)
Filter: mpp22263.stringu1::text = ('RFAAAA'::text)
Settings: optimizer=on
Optimizer status: PQO version 2.7.0
(13 rows)
-- atmsort.pm masks out differences in the Filter line, so just memorizing
-- the output of the above EXPLAIN isn't enough to catch a faulty Filter line.
-- Extract the Filter explicitly.
SELECT * from
get_explain_output($$
select * from mpp22263, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i, j)
WHERE mpp22263.unique1 = v.i and mpp22263.stringu1 = v.j;
$$) as et
WHERE et like '%Filter: %';
et
------------------------------------------------------------------
Join Filter: true
Filter: mpp22263.stringu1::text = ('RFAAAA'::text)
(2 rows)
src/test/regress/sql/gp_explain.sql
浏览文件 @
67c79899
-- Helper function, to return the EXPLAIN
ANALYZE
output of a query as a normal
-- Helper function, to return the EXPLAIN output of a query as a normal
-- result set, so that you can manipulate it further.
create
or
replace
function
get_explain_output
(
explain_query
text
)
returns
setof
text
as
$$
declare
explainrow
text
;
begin
for
explainrow
in
execute
'EXPLAIN '
||
explain_query
loop
return
next
explainrow
;
end
loop
;
end
;
$$
language
plpgsql
;
-- Same, for EXPLAIN ANALYZE
create
or
replace
function
get_explain_analyze_output
(
explain_query
text
)
returns
setof
text
as
$$
declare
explainrow
text
;
begin
...
...
@@ -27,7 +40,51 @@ set explain_memory_verbosity='summary';
-- The plan should consist of a Gather and a Seq Scan, with a
-- "Memory: ..." line on both nodes.
SELECT
COUNT
(
*
)
from
get_explain_output
(
$$
get_explain_
analyze_
output
(
$$
SELECT
*
FROM
explaintest
;
$$
)
as
et
WHERE
et
like
'%Memory: %'
;
reset
explain_memory_verbosity
;
-- Verify that the column references are OK. This tests for an old ORCA bug,
-- where the Filter clause in the IndexScan of this query was incorrectly
-- printed as something like:
--
-- Filter: "outer".column2 = mpp22263.*::text
CREATE
TABLE
mpp22263
(
unique1
int4
,
unique2
int4
,
two
int4
,
four
int4
,
ten
int4
,
twenty
int4
,
hundred
int4
,
thousand
int4
,
twothousand
int4
,
fivethous
int4
,
tenthous
int4
,
odd
int4
,
even
int4
,
stringu1
name
,
stringu2
name
,
string4
name
)
distributed
by
(
unique1
);
create
index
mpp22263_idx1
on
mpp22263
using
btree
(
unique1
);
explain
select
*
from
mpp22263
,
(
values
(
147
,
'RFAAAA'
),
(
931
,
'VJAAAA'
))
as
v
(
i
,
j
)
WHERE
mpp22263
.
unique1
=
v
.
i
and
mpp22263
.
stringu1
=
v
.
j
;
-- atmsort.pm masks out differences in the Filter line, so just memorizing
-- the output of the above EXPLAIN isn't enough to catch a faulty Filter line.
-- Extract the Filter explicitly.
SELECT
*
from
get_explain_output
(
$$
select
*
from
mpp22263
,
(
values
(
147
,
'RFAAAA'
),
(
931
,
'VJAAAA'
))
as
v
(
i
,
j
)
WHERE
mpp22263
.
unique1
=
v
.
i
and
mpp22263
.
stringu1
=
v
.
j
;
$$
)
as
et
WHERE
et
like
'%Filter: %'
;
src/test/tinc/tincrepo/query/indexapply/expected_bfv_other/mpp22263.ans
已删除
100644 → 0
浏览文件 @
4debd98c
-- start_ignore
SET optimizer_log=on;
SET
SET optimizer_enable_indexjoin=on;
SET
SET optimizer=on;
SET
SET optimizer_log=on;
SET
-- end_ignore
-- @author onosen
-- @created 2015-01-08 18:00:00
-- @tags ORCA bfv
-- @gpopt 1.522
-- @description bfv for MPP-22263
\!grep 'Filter: mpp22263.stringu1::text = "outer".column2'
Filter: mpp22263.stringu1::text = "outer".column2
\!grep 'Filter: mpp22263.stringu1::text = "outer".column2'
src/test/tinc/tincrepo/query/indexapply/sql_bfv_other/init_file
已删除
100644 → 0
浏览文件 @
4debd98c
-- start_matchsubs
m/\\\!grep 'Filter: mpp22263.stringu1::text = "outer".column2'.*/
s/\\\!grep 'Filter: mpp22263.stringu1::text = "outer".column2'.*/\!grep 'Filter: mpp22263.stringu1::text = "outer".column2'/
-- end_matchsubs
\ No newline at end of file
src/test/tinc/tincrepo/query/indexapply/sql_bfv_other/mpp22263.sql
已删除
100644 → 0
浏览文件 @
4debd98c
-- @author onosen
-- @created 2015-01-08 18:00:00
-- @tags ORCA bfv
-- @gpopt 1.522
-- @description bfv for MPP-22263
-- @skip MPP-22263
--start_ignore
explain
select
*
from
mpp22263
,
(
values
(
147
,
'RFAAAA'
),
(
931
,
'VJAAAA'
))
as
v
(
i
,
j
)
WHERE
mpp22263
.
unique1
=
v
.
i
and
mpp22263
.
stringu1
=
v
.
j
;
--end_ignore
\
!
grep
'Filter: mpp22263.stringu1::text = "outer".column2'
%
MYD
%/
output_bfv_other
/
mpp22263_orca
.
out
src/test/tinc/tincrepo/query/indexapply/sql_bfv_other/mpp22263_setup.sql
已删除
100644 → 0
浏览文件 @
4debd98c
drop
table
if
exists
mpp22263
;
CREATE
TABLE
mpp22263
(
unique1
int4
,
unique2
int4
,
two
int4
,
four
int4
,
ten
int4
,
twenty
int4
,
hundred
int4
,
thousand
int4
,
twothousand
int4
,
fivethous
int4
,
tenthous
int4
,
odd
int4
,
even
int4
,
stringu1
name
,
stringu2
name
,
string4
name
)
distributed
by
(
unique1
);
create
index
mpp22263_idx1
on
mpp22263
using
btree
(
unique1
);
src/test/tinc/tincrepo/query/indexapply/test_indexapply_bfv.py
浏览文件 @
67c79899
...
...
@@ -22,21 +22,3 @@ class Bfv_IndexApply_index_on_nondist_int(IndexApplyTestCase):
out_dir
=
'output_bfv_index_on_nondist_int/'
template_dir
=
'template'
template_subs
=
{
'%MYD%'
:
MYD
,
'%idxtype%'
:
'btree'
,
'%datatype%'
:
'int'
,
'%xDIST%'
:
'i'
,
'%yDIST%'
:
'i'
,
'%xIDX%'
:
'NONE'
,
'%yIDX%'
:
'j'
,
'%ADD%'
:
'+'
,
'%xPART%'
:
''
,
'%yPART%'
:
''
}
class
Bfv_IndexApply_Other
(
SQLTestCase
):
'''
tests for other BFVs that don't fit the scenario from IndexApplyTestCase
@optimizer_mode on
@gucs optimizer_enable_indexjoin=on; optimizer_log=on
@product_version gpdb: [4.3.3-]
'''
sql_dir
=
'sql_bfv_other/'
ans_dir
=
'expected_bfv_other/'
out_dir
=
'output_bfv_other/'
@
classmethod
def
get_substitutions
(
self
):
MYD
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
substitutions
=
{
'%MYD%'
:
MYD
}
return
substitutions
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录