Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
4f6c49fe
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,发现更多精彩内容 >>
提交
4f6c49fe
编写于
2月 22, 2001
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up index/btree comments/macros, as approved.
上级
660ca3e0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
52 addition
and
42 deletion
+52
-42
src/backend/access/common/indextuple.c
src/backend/access/common/indextuple.c
+4
-4
src/backend/access/gist/gist.c
src/backend/access/gist/gist.c
+2
-2
src/backend/access/hash/hash.c
src/backend/access/hash/hash.c
+3
-3
src/backend/access/hash/hashutil.c
src/backend/access/hash/hashutil.c
+2
-2
src/include/access/itup.h
src/include/access/itup.h
+14
-11
src/include/access/nbtree.h
src/include/access/nbtree.h
+27
-20
未找到文件。
src/backend/access/common/indextuple.c
浏览文件 @
4f6c49fe
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.5
1 2001/02/15 20:57:01 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/indextuple.c,v 1.5
2 2001/02/22 21:48:48 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -230,7 +230,7 @@ nocache_index_getattr(IndexTuple tup,
attnum
--
;
if
(
IndexTupleNo
Nulls
(
tup
))
if
(
!
IndexTupleHas
Nulls
(
tup
))
{
#ifdef IN_MACRO
/* This is handled in the macro */
...
...
@@ -301,7 +301,7 @@ nocache_index_getattr(IndexTuple tup,
return
fetchatt
(
att
[
attnum
],
tp
+
att
[
attnum
]
->
attcacheoff
);
}
else
if
(
!
IndexTupleAllFixed
(
tup
))
else
if
(
IndexTupleHasVarlenas
(
tup
))
{
int
j
;
...
...
@@ -365,7 +365,7 @@ nocache_index_getattr(IndexTuple tup,
for
(
i
=
0
;
i
<
attnum
;
i
++
)
{
if
(
!
IndexTupleNo
Nulls
(
tup
))
if
(
IndexTupleHas
Nulls
(
tup
))
{
if
(
att_isnull
(
i
,
bp
))
{
...
...
src/backend/access/gist/gist.c
浏览文件 @
4f6c49fe
...
...
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.
69 2001/01/29 00:39:12 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.
70 2001/02/22 21:48:48 momjian
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -1102,7 +1102,7 @@ gist_tuple_replacekey(Relation r, GISTENTRY entry, IndexTuple t)
{
memcpy
(
datum
,
entry
.
pred
,
entry
.
bytes
);
/* clear out old size */
t
->
t_info
&=
0xe000
;
t
->
t_info
&=
~
INDEX_SIZE_MASK
;
/* or in new size */
t
->
t_info
|=
MAXALIGN
(
entry
.
bytes
+
sizeof
(
IndexTupleData
));
...
...
src/backend/access/hash/hash.c
浏览文件 @
4f6c49fe
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.4
8 2001/01/29 00:39:13 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hash.c,v 1.4
9 2001/02/22 21:48:49 momjian
Exp $
*
* NOTES
* This file contains only the public interface routines.
...
...
@@ -170,7 +170,7 @@ hashbuild(PG_FUNCTION_ARGS)
* of the way nulls are handled here.
*/
if
(
itup
->
t_info
&
INDEX_NULL_MASK
)
if
(
IndexTupleHasNulls
(
itup
)
)
{
pfree
(
itup
);
continue
;
...
...
@@ -256,7 +256,7 @@ hashinsert(PG_FUNCTION_ARGS)
itup
=
index_formtuple
(
RelationGetDescr
(
rel
),
datum
,
nulls
);
itup
->
t_tid
=
*
ht_ctid
;
if
(
itup
->
t_info
&
INDEX_NULL_MASK
)
if
(
IndexTupleHasNulls
(
itup
)
)
PG_RETURN_POINTER
((
InsertIndexResult
)
NULL
);
hitem
=
_hash_formitem
(
itup
);
...
...
src/backend/access/hash/hashutil.c
浏览文件 @
4f6c49fe
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.2
5 2001/01/24 19:42:47
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashutil.c,v 1.2
6 2001/02/22 21:48:49
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -72,7 +72,7 @@ _hash_formitem(IndexTuple itup)
Size
tuplen
;
/* disallow nulls in hash keys */
if
(
itup
->
t_info
&
INDEX_NULL_MASK
)
if
(
IndexTupleHasNulls
(
itup
)
)
elog
(
ERROR
,
"hash indices cannot include null keys"
);
/* make a copy of the index tuple with room for the sequence number */
...
...
src/include/access/itup.h
浏览文件 @
4f6c49fe
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: itup.h,v 1.
29 2001/02/21 19:07:04
momjian Exp $
* $Id: itup.h,v 1.
30 2001/02/22 21:48:49
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -24,12 +24,14 @@ typedef struct IndexTupleData
{
ItemPointerData
t_tid
;
/* reference TID to heap tuple */
/*
/*
---------------
* t_info is layed out in the following fashion:
*
* 15th (leftmost) bit: "has nulls" bit 14th bit: "has varlenas" bit 13th
* bit: "has rules" bit - (removed ay 11/94) bits 12-0 bit: size of
* tuple.
* 15th (high) bit: has nulls
* 14th bit: has varlenas
* 13th bit: unused
* 12-0 bit: size of tuple
* ---------------
*/
unsigned
short
t_info
;
/* various info about tuple */
...
...
@@ -69,13 +71,14 @@ typedef RetrieveIndexResultData *RetrieveIndexResult;
#define INDEX_SIZE_MASK 0x1FFF
#define INDEX_NULL_MASK 0x8000
#define INDEX_VAR_MASK 0x4000
/* bit 0x2000 is not used */
#define IndexTupleSize(itup)
((Size) (((IndexTuple) (itup))->t_info & 0x1FFF
))
#define IndexTupleDSize(itup)
((Size) ((itup).t_info & 0x1FFF
))
#define IndexTuple
NoNulls(itup) (!(((IndexTuple) (itup))->t_info & 0x8000
))
#define IndexTuple
AllFixed(itup) (!(((IndexTuple) (itup))->t_info & 0x4000
))
#define IndexTupleSize(itup)
((Size) (((IndexTuple) (itup))->t_info & INDEX_SIZE_MASK
))
#define IndexTupleDSize(itup)
((Size) ((itup).t_info & INDEX_SIZE_MASK
))
#define IndexTuple
HasNulls(itup) ((((IndexTuple) (itup))->t_info & INDEX_NULL_MASK
))
#define IndexTuple
HasVarlenas(itup) ((((IndexTuple) (itup))->t_info & INDEX_VAR_MASK
))
#define IndexTupleHasMinHeader(itup) (
IndexTupleNo
Nulls(itup))
#define IndexTupleHasMinHeader(itup) (
!IndexTupleHas
Nulls(itup))
/*
* Takes an infomask as argument (primarily because this needs to be usable
...
...
@@ -107,7 +110,7 @@ typedef RetrieveIndexResultData *RetrieveIndexResult;
( \
AssertMacro(PointerIsValid(isnull) && (attnum) > 0), \
*(isnull) = false, \
IndexTupleNo
Nulls(tup) ? \
!IndexTupleHas
Nulls(tup) ? \
( \
(tupleDesc)->attrs[(attnum)-1]->attcacheoff >= 0 ? \
( \
...
...
src/include/access/nbtree.h
浏览文件 @
4f6c49fe
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: nbtree.h,v 1.5
2 2001/02/21 19:07:04
momjian Exp $
* $Id: nbtree.h,v 1.5
3 2001/02/22 21:48:49
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -21,8 +21,9 @@
/*
* BTPageOpaqueData -- At the end of every page, we store a pointer
* to both siblings in the tree. See Lehman and Yao's paper for more
* info. In addition, we need to know what sort of page this is
* to both siblings in the tree. This is used to do forward/backward
* index scans. See Lehman and Yao's paper for more
* info. In addition, we need to know what type of page this is
* (leaf or internal), and whether the page is available for reuse.
*
* We also store a back-link to the parent page, but this cannot be trusted
...
...
@@ -32,31 +33,28 @@
typedef
struct
BTPageOpaqueData
{
BlockNumber
btpo_prev
;
BlockNumber
btpo_next
;
BlockNumber
btpo_parent
;
uint16
btpo_flags
;
BlockNumber
btpo_prev
;
/* used for backward index scans */
BlockNumber
btpo_next
;
/* used for forward index scans */
BlockNumber
btpo_parent
;
/* pointer to parent, but not updated
on parent split */
uint16
btpo_flags
;
/* LEAF?, ROOT?, FREE?, META?, REORDER? */
}
BTPageOpaqueData
;
typedef
BTPageOpaqueData
*
BTPageOpaque
;
/* Bits defined in btpo_flags */
#define BTP_LEAF (1 << 0)
/*
It's a leaf
page */
#define BTP_ROOT (1 << 1)
/*
It's the
root page (has no parent) */
#define BTP_FREE (1 << 2)
/*
not currently used...
*/
#define BTP_META (1 << 3)
/*
Set in the meta-page only
*/
#define BTP_REORDER (1 << 4)
/* items
must be re-ordered
*/
#define BTP_LEAF (1 << 0)
/*
leaf page, if not internal
page */
#define BTP_ROOT (1 << 1)
/* root page (has no parent) */
#define BTP_FREE (1 << 2)
/*
page not in use
*/
#define BTP_META (1 << 3)
/*
meta-page
*/
#define BTP_REORDER (1 << 4)
/* items
need reordering
*/
#define BTREE_METAPAGE 0
/* first page is meta */
#define BTREE_MAGIC 0x053162
#define BTreeInvalidParent(opaque) \
(opaque->btpo_parent == InvalidBlockNumber || \
opaque->btpo_parent == BTREE_METAPAGE)
#define BTREE_VERSION 1
/*
* The Meta page is always the first page in the btree index.
* Its primary purpose is to point to the location of the btree root page.
*/
typedef
struct
BTMetaPageData
{
...
...
@@ -69,6 +67,15 @@ typedef struct BTMetaPageData
#define BTPageGetMeta(p) \
((BTMetaPageData *) &((PageHeader) p)->pd_linp[0])
#define BTREE_METAPAGE 0
/* first page is meta */
#define BTREE_MAGIC 0x053162
/* magic number of btree pages */
#define BTreeInvalidParent(opaque) \
(opaque->btpo_parent == InvalidBlockNumber || \
opaque->btpo_parent == BTREE_METAPAGE)
#define BTREE_VERSION 1
/*
* BTScanOpaqueData is used to remember which buffers we're currently
* examining in the scan. We keep these buffers pinned (but not locked,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录