Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
af59a065
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,发现更多精彩内容 >>
提交
af59a065
编写于
10月 17, 2008
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove useless mark/restore support in hash index AM, per discussion.
(I'm leaving GiST/GIN cleanup to Teodor.)
上级
3e00496d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
58 deletion
+12
-58
src/backend/access/hash/hash.c
src/backend/access/hash/hash.c
+8
-52
src/include/access/hash.h
src/include/access/hash.h
+4
-6
未找到文件。
src/backend/access/hash/hash.c
浏览文件 @
af59a065
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.10
5 2008/09/15 18:43:41
tgl Exp $
* $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.10
6 2008/10/17 23:50:57
tgl Exp $
*
* NOTES
* This file contains only the public interface routines.
...
...
@@ -345,10 +345,9 @@ hashbeginscan(PG_FUNCTION_ARGS)
so
=
(
HashScanOpaque
)
palloc
(
sizeof
(
HashScanOpaqueData
));
so
->
hashso_bucket_valid
=
false
;
so
->
hashso_bucket_blkno
=
0
;
so
->
hashso_curbuf
=
so
->
hashso_mrkbuf
=
InvalidBuffer
;
/* set position
s
invalid (this will cause _hash_first call) */
so
->
hashso_curbuf
=
InvalidBuffer
;
/* set position invalid (this will cause _hash_first call) */
ItemPointerSetInvalid
(
&
(
so
->
hashso_curpos
));
ItemPointerSetInvalid
(
&
(
so
->
hashso_mrkpos
));
scan
->
opaque
=
so
;
...
...
@@ -372,23 +371,18 @@ hashrescan(PG_FUNCTION_ARGS)
/* if we are called from beginscan, so is still NULL */
if
(
so
)
{
/* release any pin
s
we still hold */
/* release any pin we still hold */
if
(
BufferIsValid
(
so
->
hashso_curbuf
))
_hash_dropbuf
(
rel
,
so
->
hashso_curbuf
);
so
->
hashso_curbuf
=
InvalidBuffer
;
if
(
BufferIsValid
(
so
->
hashso_mrkbuf
))
_hash_dropbuf
(
rel
,
so
->
hashso_mrkbuf
);
so
->
hashso_mrkbuf
=
InvalidBuffer
;
/* release lock on bucket, too */
if
(
so
->
hashso_bucket_blkno
)
_hash_droplock
(
rel
,
so
->
hashso_bucket_blkno
,
HASH_SHARE
);
so
->
hashso_bucket_blkno
=
0
;
/* set position
s
invalid (this will cause _hash_first call) */
/* set position invalid (this will cause _hash_first call) */
ItemPointerSetInvalid
(
&
(
so
->
hashso_curpos
));
ItemPointerSetInvalid
(
&
(
so
->
hashso_mrkpos
));
}
/* Update scan key, if a new one is given */
...
...
@@ -417,15 +411,11 @@ hashendscan(PG_FUNCTION_ARGS)
/* don't need scan registered anymore */
_hash_dropscan
(
scan
);
/* release any pin
s
we still hold */
/* release any pin we still hold */
if
(
BufferIsValid
(
so
->
hashso_curbuf
))
_hash_dropbuf
(
rel
,
so
->
hashso_curbuf
);
so
->
hashso_curbuf
=
InvalidBuffer
;
if
(
BufferIsValid
(
so
->
hashso_mrkbuf
))
_hash_dropbuf
(
rel
,
so
->
hashso_mrkbuf
);
so
->
hashso_mrkbuf
=
InvalidBuffer
;
/* release lock on bucket, too */
if
(
so
->
hashso_bucket_blkno
)
_hash_droplock
(
rel
,
so
->
hashso_bucket_blkno
,
HASH_SHARE
);
...
...
@@ -443,24 +433,7 @@ hashendscan(PG_FUNCTION_ARGS)
Datum
hashmarkpos
(
PG_FUNCTION_ARGS
)
{
IndexScanDesc
scan
=
(
IndexScanDesc
)
PG_GETARG_POINTER
(
0
);
HashScanOpaque
so
=
(
HashScanOpaque
)
scan
->
opaque
;
Relation
rel
=
scan
->
indexRelation
;
/* release pin on old marked data, if any */
if
(
BufferIsValid
(
so
->
hashso_mrkbuf
))
_hash_dropbuf
(
rel
,
so
->
hashso_mrkbuf
);
so
->
hashso_mrkbuf
=
InvalidBuffer
;
ItemPointerSetInvalid
(
&
(
so
->
hashso_mrkpos
));
/* bump pin count on current buffer and copy to marked buffer */
if
(
ItemPointerIsValid
(
&
(
so
->
hashso_curpos
)))
{
IncrBufferRefCount
(
so
->
hashso_curbuf
);
so
->
hashso_mrkbuf
=
so
->
hashso_curbuf
;
so
->
hashso_mrkpos
=
so
->
hashso_curpos
;
}
elog
(
ERROR
,
"hash does not support mark/restore"
);
PG_RETURN_VOID
();
}
...
...
@@ -470,24 +443,7 @@ hashmarkpos(PG_FUNCTION_ARGS)
Datum
hashrestrpos
(
PG_FUNCTION_ARGS
)
{
IndexScanDesc
scan
=
(
IndexScanDesc
)
PG_GETARG_POINTER
(
0
);
HashScanOpaque
so
=
(
HashScanOpaque
)
scan
->
opaque
;
Relation
rel
=
scan
->
indexRelation
;
/* release pin on current data, if any */
if
(
BufferIsValid
(
so
->
hashso_curbuf
))
_hash_dropbuf
(
rel
,
so
->
hashso_curbuf
);
so
->
hashso_curbuf
=
InvalidBuffer
;
ItemPointerSetInvalid
(
&
(
so
->
hashso_curpos
));
/* bump pin count on marked buffer and copy to current buffer */
if
(
ItemPointerIsValid
(
&
(
so
->
hashso_mrkpos
)))
{
IncrBufferRefCount
(
so
->
hashso_mrkbuf
);
so
->
hashso_curbuf
=
so
->
hashso_mrkbuf
;
so
->
hashso_curpos
=
so
->
hashso_mrkpos
;
}
elog
(
ERROR
,
"hash does not support mark/restore"
);
PG_RETURN_VOID
();
}
...
...
src/include/access/hash.h
浏览文件 @
af59a065
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/access/hash.h,v 1.9
0 2008/09/15 18:43:41
tgl Exp $
* $PostgreSQL: pgsql/src/include/access/hash.h,v 1.9
1 2008/10/17 23:50:57
tgl Exp $
*
* NOTES
* modeled after Margo Seltzer's hash implementation for unix.
...
...
@@ -92,17 +92,15 @@ typedef struct HashScanOpaqueData
BlockNumber
hashso_bucket_blkno
;
/*
* We also want to remember which buffer
s
we're currently examining in the
* scan. We keep the
se buffers
pinned (but not locked) across hashgettuple
* We also want to remember which buffer we're currently examining in the
* scan. We keep the
buffer
pinned (but not locked) across hashgettuple
* calls, in order to avoid doing a ReadBuffer() for every tuple in the
* index.
*/
Buffer
hashso_curbuf
;
Buffer
hashso_mrkbuf
;
/* Current
and marked
position of the scan */
/* Current position of the scan */
ItemPointerData
hashso_curpos
;
ItemPointerData
hashso_mrkpos
;
}
HashScanOpaqueData
;
typedef
HashScanOpaqueData
*
HashScanOpaque
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录