Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
1559dba0
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,发现更多精彩内容 >>
提交
1559dba0
编写于
3月 04, 2016
作者:
S
Shreedhar Hardikar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Moved bitmapscan queries from cdbfast to ICG.
上级
0a450443
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
21346 addition
and
1 deletion
+21346
-1
src/test/regress/expected/qp_bitmapscan.out
src/test/regress/expected/qp_bitmapscan.out
+21097
-0
src/test/regress/greenplum_schedule
src/test/regress/greenplum_schedule
+1
-1
src/test/regress/sql/qp_bitmapscan.sql
src/test/regress/sql/qp_bitmapscan.sql
+248
-0
未找到文件。
src/test/regress/expected/qp_bitmapscan.out
0 → 100644
浏览文件 @
1559dba0
此差异已折叠。
点击以展开。
src/test/regress/greenplum_schedule
浏览文件 @
1559dba0
...
@@ -83,7 +83,7 @@ test: nested_case_null
...
@@ -83,7 +83,7 @@ test: nested_case_null
test: bfv_cte bfv_joins bfv_statistic bfv_subquery bfv_planner bfv_legacy
test: bfv_cte bfv_joins bfv_statistic bfv_subquery bfv_planner bfv_legacy
test: qp_executor qp_olap_windowerr qp_olap_window qp_derived_table
test: qp_executor qp_olap_windowerr qp_olap_window qp_derived_table
qp_bitmapscan
test: qp_subquery
test: qp_subquery
...
...
src/test/regress/sql/qp_bitmapscan.sql
0 → 100644
浏览文件 @
1559dba0
-- ----------------------------------------------------------------------
-- Test: setup.sql
-- ----------------------------------------------------------------------
-- start_ignore
create
schema
qp_bitmapscan
;
set
search_path
to
qp_bitmapscan
;
-- end_ignore
RESET
ALL
;
-- ----------------------------------------------------------------------
-- Test: query01.sql
-- ----------------------------------------------------------------------
-- Test Bitmap Indexscan
drop
table
if
exists
test
;
create
table
test
(
a
integer
,
b
integer
);
insert
into
test
select
a
,
a
%
25
from
generate_series
(
1
,
1000
)
a
;
create
index
test_a
on
test
(
a
);
set
enable_seqscan
=
off
;
set
enable_indexscan
=
off
;
set
enable_bitmapscan
=
on
;
-- returnning one or more tuples
select
*
from
test
where
a
<
10
;
-- returninig no tuples
select
*
from
test
where
a
>
1000
;
RESET
ALL
;
-- ----------------------------------------------------------------------
-- Test: query02.sql
-- ----------------------------------------------------------------------
-- Test Bitmap Heapscan + Bitmap And + Bitmap Indexscan
drop
table
if
exists
test
;
create
table
test
(
a
integer
,
b
integer
);
insert
into
test
select
a
%
10
,
a
%
25
from
generate_series
(
1
,
100000
)
a
;
-- Test on 2 btrees
create
index
test_a
on
test
(
a
);
create
index
test_b
on
test
(
b
);
set
enable_seqscan
=
off
;
set
enable_indexscan
=
off
;
set
enable_bitmapscan
=
on
;
-- Both branches return tuples.
select
*
from
test
where
a
=
5
and
b
=
10
;
-- One branch returns 0 tuple.
select
*
from
test
where
a
=
20
and
b
=
10
;
-- Both branches return 0 tuple.
select
*
from
test
where
a
=
20
and
b
=
30
;
-- Test on 2 bitmaps
drop
index
test_a
;
drop
index
test_b
;
create
index
test_bm_a
on
test
using
bitmap
(
a
);
create
index
test_bm_b
on
test
using
bitmap
(
b
);
select
*
from
test
where
a
=
5
and
b
=
10
;
-- One branch returns 0 tuple.
select
*
from
test
where
a
=
20
and
b
=
10
;
-- Both branches return 0 tuple.
select
*
from
test
where
a
=
20
and
b
=
30
;
-- Test on 1 btree and 1 bitmap
drop
index
test_bm_a
;
drop
index
test_bm_b
;
create
index
test_a
on
test
(
a
);
create
index
test_bm_b
on
test
using
bitmap
(
b
);
select
*
from
test
where
a
=
5
and
b
=
10
;
-- One branch returns 0 tuple.
select
*
from
test
where
a
=
20
and
b
=
10
;
-- Both branches return 0 tuple.
select
*
from
test
where
a
=
20
and
b
=
30
;
RESET
ALL
;
-- ----------------------------------------------------------------------
-- Test: query03.sql
-- ----------------------------------------------------------------------
-- Test Bitmap Heapscan + Bitmap OR + Bitmap Indexscan
drop
table
if
exists
test
;
create
table
test
(
a
integer
,
b
integer
);
insert
into
test
select
a
,
a
%
25
from
generate_series
(
1
,
1000
)
a
;
-- Test on 2 btrees
create
index
test_a
on
test
(
a
);
create
index
test_b
on
test
(
b
);
set
enable_seqscan
=
off
;
set
enable_indexscan
=
off
;
set
enable_bitmapscan
=
on
;
select
*
from
test
where
a
<
100
or
b
>
10
;
-- Returnning no tuples from one branch
select
*
from
test
where
a
<
100
or
b
>
30
;
-- Returnning no tuples from both branch
select
*
from
test
where
a
<
1
or
b
>
30
;
-- Test on 2 bitmaps
drop
index
test_a
;
drop
index
test_b
;
create
index
test_bm_a
on
test
using
bitmap
(
a
);
create
index
test_bm_b
on
test
using
bitmap
(
b
);
select
*
from
test
where
a
<
100
or
b
>
10
;
-- Returnning no tuples from one branch
select
*
from
test
where
a
<
100
or
b
>
30
;
-- Returnning no tuples from both branch
select
*
from
test
where
a
<
1
or
b
>
30
;
-- Test on 1 btree, 1 bitmap
drop
index
test_bm_a
;
drop
index
test_bm_b
;
create
index
test_a
on
test
(
a
);
create
index
test_bm_b
on
test
using
bitmap
(
b
);
select
*
from
test
where
a
<
100
or
b
>
10
;
-- Returnning no tuples from one branch
select
*
from
test
where
a
<
100
or
b
>
30
;
-- Returnning no tuples from both branch
select
*
from
test
where
a
<
1
or
b
>
30
;
RESET
ALL
;
-- ----------------------------------------------------------------------
-- Test: query04.sql
-- ----------------------------------------------------------------------
-- Test combination of BitmapAnd and BitmapOr
drop
table
if
exists
test
;
create
table
test
(
a
integer
,
b
integer
,
c
integer
);
insert
into
test
select
a
%
10
,
a
%
25
,
a
%
30
from
generate_series
(
1
,
100000
)
a
;
-- Test BitmapAnd + 2 (BitmapOr)
create
index
test_a
on
test
(
a
);
create
index
test_b
on
test
(
b
);
create
index
test_c
on
test
(
c
);
set
enable_seqscan
=
off
;
set
enable_indexscan
=
off
;
set
enable_bitmapscan
=
on
;
select
*
from
test
where
a
=
5
and
(
b
=
10
or
c
=
20
);
-- Test BitmapOr + 2 (BitmapAnd)
select
*
from
test
where
a
=
5
or
(
b
=
10
and
c
=
20
);
RESET
ALL
;
-- ----------------------------------------------------------------------
-- Test: query05.sql
-- ----------------------------------------------------------------------
-- Test ArrayKeys
drop
table
if
exists
test
;
create
table
test
(
a
integer
,
b
integer
);
insert
into
test
select
a
,
a
%
25
from
generate_series
(
1
,
1000
)
a
;
create
index
test_a
on
test
(
a
);
set
enable_seqscan
=
off
;
set
enable_indexscan
=
off
;
set
enable_bitmapscan
=
on
;
select
*
from
test
where
a
in
(
1
,
3
,
5
);
RESET
ALL
;
-- ----------------------------------------------------------------------
-- Test: query08.sql
-- ----------------------------------------------------------------------
drop
table
if
exists
foo
;
create
table
foo
(
a
int
,
b
char
(
20
));
insert
into
foo
select
a
from
generate_series
(
1
,
10000
)
a
;
select
count
(
*
)
from
foo
;
update
foo
set
b
=
'A'
;
create
index
foo_idx
on
foo
using
bitmap
(
b
);
insert
into
foo
select
a
from
generate_series
(
1
,
10000
)
a
;
update
foo
set
b
=
'B'
where
b
is
null
;
vacuum
full
foo
;
RESET
ALL
;
-- ----------------------------------------------------------------------
-- Test: query09.sql
-- ----------------------------------------------------------------------
----------------------------------------------------------------
create
table
mpp8014
(
i
int
)
distributed
by
(
i
);
create
index
mpp8014_bitmap_idx
on
mpp8014
using
bitmap
(
i
);
select
localoid
::
regclass
,
attrnums
from
gp_distribution_policy
where
localoid
=
'mpp8014'
::
regclass
order
by
localoid
::
regclass
;
RESET
ALL
;
-- ----------------------------------------------------------------------
-- Test: query10.sql
-- ----------------------------------------------------------------------
create
table
mpp7966
(
i
int
,
j
int
,
k
int
);
insert
into
mpp7966
select
i
,
i
%
123
,
i
%
234
from
generate_series
(
0
,
9999
)
i
;
insert
into
mpp7966
select
i
,
(
random
()::
int
*
1000000
)
%
123
,
i
%
234
from
generate_series
(
0
,
9999
)
i
;
insert
into
mpp7966
select
*
from
mpp7966
;
insert
into
mpp7966
select
*
from
mpp7966
;
insert
into
mpp7966
select
*
from
mpp7966
;
insert
into
mpp7966
select
*
from
mpp7966
;
create
index
mpp7966_j
on
mpp7966
using
bitmap
(
j
);
vacuum
mpp7966
;
analyze
mpp7966
;
select
count
(
*
)
from
mpp7966
where
j
in
(
1
,
20
);
select
count
(
*
)
from
mpp7966
where
j
in
(
1
,
20
,
30
);
select
count
(
*
)
from
mpp7966
where
j
in
(
11
,
22
,
33
);
drop
table
mpp7966
;
RESET
ALL
;
-- ----------------------------------------------------------------------
-- Test: teardown.sql
-- ----------------------------------------------------------------------
-- start_ignore
drop
schema
qp_bitmapscan
cascade
;
-- end_ignore
RESET
ALL
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录