Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
13dadef8
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,发现更多精彩内容 >>
提交
13dadef8
编写于
2月 23, 2003
作者:
T
Tom Lane
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve coding of log_heap_clean() and heap_xlog_clean().
上级
88dc31e3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
33 addition
and
40 deletion
+33
-40
src/backend/access/heap/heapam.c
src/backend/access/heap/heapam.c
+23
-24
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+5
-9
src/backend/commands/vacuumlazy.c
src/backend/commands/vacuumlazy.c
+3
-5
src/include/access/heapam.h
src/include/access/heapam.h
+2
-2
未找到文件。
src/backend/access/heap/heapam.c
浏览文件 @
13dadef8
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.15
0 2003/02/13 05:35:07 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.15
1 2003/02/23 20:32:11 tgl
Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -1891,36 +1891,40 @@ heap_restrpos(HeapScanDesc scan)
}
XLogRecPtr
log_heap_clean
(
Relation
reln
,
Buffer
buffer
,
char
*
unused
,
int
unlen
)
log_heap_clean
(
Relation
reln
,
Buffer
buffer
,
OffsetNumber
*
unused
,
int
uncnt
)
{
xl_heap_clean
xlrec
;
XLogRecPtr
recptr
;
XLogRecData
rdata
[
3
];
XLogRecData
rdata
[
2
];
/* Caller should not call me on a temp relation */
Assert
(
!
reln
->
rd_istemp
);
xlrec
.
node
=
reln
->
rd_node
;
xlrec
.
block
=
BufferGetBlockNumber
(
buffer
);
rdata
[
0
].
buffer
=
InvalidBuffer
;
rdata
[
0
].
data
=
(
char
*
)
&
xlrec
;
rdata
[
0
].
len
=
SizeOfHeapClean
;
rdata
[
0
].
next
=
&
(
rdata
[
1
]);
if
(
unlen
>
0
)
/*
* The unused-offsets array is not actually in the buffer, but pretend
* that it is. When XLogInsert stores the whole buffer, the offsets
* array need not be stored too.
*/
rdata
[
1
].
buffer
=
buffer
;
if
(
uncnt
>
0
)
{
rdata
[
1
].
buffer
=
buffer
;
rdata
[
1
].
data
=
unused
;
rdata
[
1
].
len
=
unlen
;
rdata
[
1
].
next
=
&
(
rdata
[
2
]);
rdata
[
1
].
data
=
(
char
*
)
unused
;
rdata
[
1
].
len
=
uncnt
*
sizeof
(
OffsetNumber
);
}
else
rdata
[
0
].
next
=
&
(
rdata
[
2
]);
rdata
[
2
].
buffer
=
buffer
;
rdata
[
2
].
data
=
NULL
;
rdata
[
2
].
len
=
0
;
rdata
[
2
].
next
=
NULL
;
{
rdata
[
1
].
data
=
NULL
;
rdata
[
1
].
len
=
0
;
}
rdata
[
1
].
next
=
NULL
;
recptr
=
XLogInsert
(
RM_HEAP_ID
,
XLOG_HEAP_CLEAN
,
rdata
);
...
...
@@ -2032,7 +2036,6 @@ heap_xlog_clean(bool redo, XLogRecPtr lsn, XLogRecord *record)
return
;
reln
=
XLogOpenRelation
(
redo
,
RM_HEAP_ID
,
xlrec
->
node
);
if
(
!
RelationIsValid
(
reln
))
return
;
...
...
@@ -2052,18 +2055,14 @@ heap_xlog_clean(bool redo, XLogRecPtr lsn, XLogRecord *record)
if
(
record
->
xl_len
>
SizeOfHeapClean
)
{
OffsetNumber
unbuf
[
BLCKSZ
/
sizeof
(
OffsetNumber
)];
OffsetNumber
*
unused
=
unbuf
;
char
*
unend
;
OffsetNumber
*
unused
;
OffsetNumber
*
unend
;
ItemId
lp
;
Assert
((
record
->
xl_len
-
SizeOfHeapClean
)
<=
BLCKSZ
);
memcpy
((
char
*
)
unbuf
,
(
char
*
)
xlrec
+
SizeOfHeapClean
,
record
->
xl_len
-
SizeOfHeapClean
);
unend
=
(
char
*
)
unbuf
+
(
record
->
xl_len
-
SizeOfHeapClean
);
unused
=
(
OffsetNumber
*
)
((
char
*
)
xlrec
+
SizeOfHeapClean
);
unend
=
(
OffsetNumber
*
)
((
char
*
)
xlrec
+
record
->
xl_len
);
while
(
(
char
*
)
unused
<
unend
)
while
(
unused
<
unend
)
{
lp
=
PageGetItemId
(
page
,
*
unused
+
1
);
lp
->
lp_flags
&=
~
LP_USED
;
...
...
src/backend/commands/vacuum.c
浏览文件 @
13dadef8
...
...
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.24
8 2003/02/22 00:45:05
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.24
9 2003/02/23 20:32:12
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -2386,8 +2386,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
if
(
vacpage
->
blkno
==
(
blkno
-
1
)
&&
vacpage
->
offsets_free
>
0
)
{
OffsetNumber
unbuf
[
BLCKSZ
/
sizeof
(
OffsetNumber
)];
OffsetNumber
*
unused
=
unbuf
;
OffsetNumber
unused
[
BLCKSZ
/
sizeof
(
OffsetNumber
)];
int
uncnt
;
buf
=
ReadBuffer
(
onerel
,
vacpage
->
blkno
);
...
...
@@ -2430,8 +2429,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
{
XLogRecPtr
recptr
;
recptr
=
log_heap_clean
(
onerel
,
buf
,
(
char
*
)
unused
,
(
char
*
)
(
&
(
unused
[
uncnt
]))
-
(
char
*
)
unused
);
recptr
=
log_heap_clean
(
onerel
,
buf
,
unused
,
uncnt
);
PageSetLSN
(
page
,
recptr
);
PageSetSUI
(
page
,
ThisStartUpID
);
}
...
...
@@ -2555,8 +2553,7 @@ vacuum_heap(VRelStats *vacrelstats, Relation onerel, VacPageList vacuum_pages)
static
void
vacuum_page
(
Relation
onerel
,
Buffer
buffer
,
VacPage
vacpage
)
{
OffsetNumber
unbuf
[
BLCKSZ
/
sizeof
(
OffsetNumber
)];
OffsetNumber
*
unused
=
unbuf
;
OffsetNumber
unused
[
BLCKSZ
/
sizeof
(
OffsetNumber
)];
int
uncnt
;
Page
page
=
BufferGetPage
(
buffer
);
ItemId
itemid
;
...
...
@@ -2580,8 +2577,7 @@ vacuum_page(Relation onerel, Buffer buffer, VacPage vacpage)
{
XLogRecPtr
recptr
;
recptr
=
log_heap_clean
(
onerel
,
buffer
,
(
char
*
)
unused
,
(
char
*
)
(
&
(
unused
[
uncnt
]))
-
(
char
*
)
unused
);
recptr
=
log_heap_clean
(
onerel
,
buffer
,
unused
,
uncnt
);
PageSetLSN
(
page
,
recptr
);
PageSetSUI
(
page
,
ThisStartUpID
);
}
...
...
src/backend/commands/vacuumlazy.c
浏览文件 @
13dadef8
...
...
@@ -31,7 +31,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuumlazy.c,v 1.2
4 2003/02/22 00:45:05
tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuumlazy.c,v 1.2
5 2003/02/23 20:32:12
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -497,8 +497,7 @@ static int
lazy_vacuum_page
(
Relation
onerel
,
BlockNumber
blkno
,
Buffer
buffer
,
int
tupindex
,
LVRelStats
*
vacrelstats
)
{
OffsetNumber
unbuf
[
BLCKSZ
/
sizeof
(
OffsetNumber
)];
OffsetNumber
*
unused
=
unbuf
;
OffsetNumber
unused
[
BLCKSZ
/
sizeof
(
OffsetNumber
)];
int
uncnt
;
Page
page
=
BufferGetPage
(
buffer
);
ItemId
itemid
;
...
...
@@ -524,8 +523,7 @@ lazy_vacuum_page(Relation onerel, BlockNumber blkno, Buffer buffer,
{
XLogRecPtr
recptr
;
recptr
=
log_heap_clean
(
onerel
,
buffer
,
(
char
*
)
unused
,
(
char
*
)
(
&
(
unused
[
uncnt
]))
-
(
char
*
)
unused
);
recptr
=
log_heap_clean
(
onerel
,
buffer
,
unused
,
uncnt
);
PageSetLSN
(
page
,
recptr
);
PageSetSUI
(
page
,
ThisStartUpID
);
}
...
...
src/include/access/heapam.h
浏览文件 @
13dadef8
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: heapam.h,v 1.8
0 2003/02/13 05:35:11 momjian
Exp $
* $Id: heapam.h,v 1.8
1 2003/02/23 20:32:12 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -173,7 +173,7 @@ extern void heap_redo(XLogRecPtr lsn, XLogRecord *rptr);
extern
void
heap_undo
(
XLogRecPtr
lsn
,
XLogRecord
*
rptr
);
extern
void
heap_desc
(
char
*
buf
,
uint8
xl_info
,
char
*
rec
);
extern
XLogRecPtr
log_heap_clean
(
Relation
reln
,
Buffer
buffer
,
char
*
unused
,
int
unlen
);
OffsetNumber
*
unused
,
int
uncnt
);
extern
XLogRecPtr
log_heap_move
(
Relation
reln
,
Buffer
oldbuf
,
ItemPointerData
from
,
Buffer
newbuf
,
HeapTuple
newtup
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录