Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
3afffbc9
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,发现更多精彩内容 >>
提交
3afffbc9
编写于
10月 20, 2008
作者:
T
Teodor Sigaev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove support of backward scan in GiST. Per discussion
http://archives.postgresql.org/pgsql-hackers/2008-10/msg00857.php
上级
a6ebb1f2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
25 deletion
+15
-25
src/backend/access/gist/gistget.c
src/backend/access/gist/gistget.c
+15
-25
未找到文件。
src/backend/access/gist/gistget.c
浏览文件 @
3afffbc9
...
...
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.7
7 2008/10/20 13:39:4
4 teodor Exp $
* $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.7
8 2008/10/20 16:35:1
4 teodor Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -23,9 +23,8 @@
#include "utils/memutils.h"
static
OffsetNumber
gistfindnext
(
IndexScanDesc
scan
,
OffsetNumber
n
,
ScanDirection
dir
);
static
int64
gistnext
(
IndexScanDesc
scan
,
ScanDirection
dir
,
TIDBitmap
*
tbm
);
static
OffsetNumber
gistfindnext
(
IndexScanDesc
scan
,
OffsetNumber
n
);
static
int64
gistnext
(
IndexScanDesc
scan
,
TIDBitmap
*
tbm
);
static
bool
gistindex_keytest
(
IndexTuple
tuple
,
IndexScanDesc
scan
,
OffsetNumber
offset
);
...
...
@@ -80,6 +79,9 @@ gistgettuple(PG_FUNCTION_ARGS)
so
=
(
GISTScanOpaque
)
scan
->
opaque
;
if
(
dir
!=
ForwardScanDirection
)
elog
(
ERROR
,
"GiST doesn't support other scan directions than forward"
);
/*
* If we have produced an index tuple in the past and the executor has
* informed us we need to mark it as "killed", do so now.
...
...
@@ -90,7 +92,7 @@ gistgettuple(PG_FUNCTION_ARGS)
/*
* Get the next tuple that matches the search key.
*/
res
=
(
gistnext
(
scan
,
dir
,
NULL
)
>
0
);
res
=
(
gistnext
(
scan
,
NULL
)
>
0
);
PG_RETURN_BOOL
(
res
);
}
...
...
@@ -102,7 +104,7 @@ gistgetbitmap(PG_FUNCTION_ARGS)
TIDBitmap
*
tbm
=
(
TIDBitmap
*
)
PG_GETARG_POINTER
(
1
);
int64
ntids
;
ntids
=
gistnext
(
scan
,
ForwardScanDirection
,
tbm
);
ntids
=
gistnext
(
scan
,
tbm
);
PG_RETURN_INT64
(
ntids
);
}
...
...
@@ -122,7 +124,7 @@ gistgetbitmap(PG_FUNCTION_ARGS)
* non-killed tuple that matches the search key.
*/
static
int64
gistnext
(
IndexScanDesc
scan
,
ScanDirection
dir
,
TIDBitmap
*
tbm
)
gistnext
(
IndexScanDesc
scan
,
TIDBitmap
*
tbm
)
{
Page
p
;
OffsetNumber
n
;
...
...
@@ -169,9 +171,6 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
if
(
so
->
curPageData
<
so
->
nPageData
)
{
/*
* pageData is already ordered for scan's direction
*/
scan
->
xs_ctup
.
t_self
=
so
->
pageData
[
so
->
curPageData
].
iptr
;
scan
->
xs_recheck
=
so
->
pageData
[
so
->
curPageData
].
recheck
;
so
->
curPageData
++
;
...
...
@@ -252,17 +251,14 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
continue
;
}
if
(
ScanDirectionIsBackward
(
dir
))
n
=
PageGetMaxOffsetNumber
(
p
);
else
n
=
FirstOffsetNumber
;
n
=
FirstOffsetNumber
;
/* wonderful, we can look at page */
so
->
nPageData
=
so
->
curPageData
=
0
;
for
(;;)
{
n
=
gistfindnext
(
scan
,
n
,
dir
);
n
=
gistfindnext
(
scan
,
n
);
if
(
!
OffsetNumberIsValid
(
n
))
{
...
...
@@ -275,7 +271,7 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
if
(
!
tbm
&&
so
->
nPageData
>
0
)
{
LockBuffer
(
so
->
curbuf
,
GIST_UNLOCK
);
return
gistnext
(
scan
,
dir
,
NULL
);
return
gistnext
(
scan
,
NULL
);
}
/*
...
...
@@ -346,10 +342,7 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
so
->
stack
->
next
=
stk
;
}
if
(
ScanDirectionIsBackward
(
dir
))
n
=
OffsetNumberPrev
(
n
);
else
n
=
OffsetNumberNext
(
n
);
n
=
OffsetNumberNext
(
n
);
}
}
...
...
@@ -475,7 +468,7 @@ gistindex_keytest(IndexTuple tuple,
* Page should be locked....
*/
static
OffsetNumber
gistfindnext
(
IndexScanDesc
scan
,
OffsetNumber
n
,
ScanDirection
dir
)
gistfindnext
(
IndexScanDesc
scan
,
OffsetNumber
n
)
{
OffsetNumber
maxoff
;
IndexTuple
it
;
...
...
@@ -500,10 +493,7 @@ gistfindnext(IndexScanDesc scan, OffsetNumber n, ScanDirection dir)
if
(
gistindex_keytest
(
it
,
scan
,
n
))
break
;
if
(
ScanDirectionIsBackward
(
dir
))
n
=
OffsetNumberPrev
(
n
);
else
n
=
OffsetNumberNext
(
n
);
n
=
OffsetNumberNext
(
n
);
}
MemoryContextSwitchTo
(
oldcxt
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录