Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
6287eb7a
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,发现更多精彩内容 >>
提交
6287eb7a
编写于
3月 23, 2007
作者:
A
Alvaro Herrera
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Separate fetch of pg_autovacuum tuple into its own function.
上级
8aaecaf8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
14 deletion
+35
-14
src/backend/postmaster/autovacuum.c
src/backend/postmaster/autovacuum.c
+35
-14
未找到文件。
src/backend/postmaster/autovacuum.c
浏览文件 @
6287eb7a
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.3
5 2007/03/23 20:56:39
alvherre Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/autovacuum.c,v 1.3
6 2007/03/23 21:23:13
alvherre Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -127,6 +127,7 @@ static void test_rel_for_autovac(Oid relid, PgStat_StatTabEntry *tabentry,
...
@@ -127,6 +127,7 @@ static void test_rel_for_autovac(Oid relid, PgStat_StatTabEntry *tabentry,
List
**
toast_table_ids
);
List
**
toast_table_ids
);
static
void
autovacuum_do_vac_analyze
(
Oid
relid
,
bool
dovacuum
,
static
void
autovacuum_do_vac_analyze
(
Oid
relid
,
bool
dovacuum
,
bool
doanalyze
,
int
freeze_min_age
);
bool
doanalyze
,
int
freeze_min_age
);
static
HeapTuple
get_pg_autovacuum_tuple_relid
(
Relation
avRel
,
Oid
relid
);
static
void
autovac_report_activity
(
VacuumStmt
*
vacstmt
,
Oid
relid
);
static
void
autovac_report_activity
(
VacuumStmt
*
vacstmt
,
Oid
relid
);
static
void
avl_sighup_handler
(
SIGNAL_ARGS
);
static
void
avl_sighup_handler
(
SIGNAL_ARGS
);
static
void
avlauncher_shutdown
(
SIGNAL_ARGS
);
static
void
avlauncher_shutdown
(
SIGNAL_ARGS
);
...
@@ -933,9 +934,7 @@ do_autovacuum(PgStat_StatDBEntry *dbentry)
...
@@ -933,9 +934,7 @@ do_autovacuum(PgStat_StatDBEntry *dbentry)
Form_pg_class
classForm
=
(
Form_pg_class
)
GETSTRUCT
(
tuple
);
Form_pg_class
classForm
=
(
Form_pg_class
)
GETSTRUCT
(
tuple
);
Form_pg_autovacuum
avForm
=
NULL
;
Form_pg_autovacuum
avForm
=
NULL
;
PgStat_StatTabEntry
*
tabentry
;
PgStat_StatTabEntry
*
tabentry
;
SysScanDesc
avScan
;
HeapTuple
avTup
;
HeapTuple
avTup
;
ScanKeyData
entry
[
1
];
Oid
relid
;
Oid
relid
;
/* Consider only regular and toast tables. */
/* Consider only regular and toast tables. */
...
@@ -952,16 +951,8 @@ do_autovacuum(PgStat_StatDBEntry *dbentry)
...
@@ -952,16 +951,8 @@ do_autovacuum(PgStat_StatDBEntry *dbentry)
relid
=
HeapTupleGetOid
(
tuple
);
relid
=
HeapTupleGetOid
(
tuple
);
/* See if we have a pg_autovacuum entry for this relation. */
/* Fetch the pg_autovacuum tuple for the relation, if any */
ScanKeyInit
(
&
entry
[
0
],
avTup
=
get_pg_autovacuum_tuple_relid
(
avRel
,
relid
);
Anum_pg_autovacuum_vacrelid
,
BTEqualStrategyNumber
,
F_OIDEQ
,
ObjectIdGetDatum
(
relid
));
avScan
=
systable_beginscan
(
avRel
,
AutovacuumRelidIndexId
,
true
,
SnapshotNow
,
1
,
entry
);
avTup
=
systable_getnext
(
avScan
);
if
(
HeapTupleIsValid
(
avTup
))
if
(
HeapTupleIsValid
(
avTup
))
avForm
=
(
Form_pg_autovacuum
)
GETSTRUCT
(
avTup
);
avForm
=
(
Form_pg_autovacuum
)
GETSTRUCT
(
avTup
);
...
@@ -978,7 +969,8 @@ do_autovacuum(PgStat_StatDBEntry *dbentry)
...
@@ -978,7 +969,8 @@ do_autovacuum(PgStat_StatDBEntry *dbentry)
test_rel_for_autovac
(
relid
,
tabentry
,
classForm
,
avForm
,
test_rel_for_autovac
(
relid
,
tabentry
,
classForm
,
avForm
,
&
vacuum_tables
,
&
toast_table_ids
);
&
vacuum_tables
,
&
toast_table_ids
);
systable_endscan
(
avScan
);
if
(
HeapTupleIsValid
(
avTup
))
heap_freetuple
(
avTup
);
}
}
heap_endscan
(
relScan
);
heap_endscan
(
relScan
);
...
@@ -1030,6 +1022,35 @@ do_autovacuum(PgStat_StatDBEntry *dbentry)
...
@@ -1030,6 +1022,35 @@ do_autovacuum(PgStat_StatDBEntry *dbentry)
CommitTransactionCommand
();
CommitTransactionCommand
();
}
}
/*
* Returns a copy of the pg_autovacuum tuple for the given relid, or NULL if
* there isn't any. avRel is pg_autovacuum, already open and suitably locked.
*/
static
HeapTuple
get_pg_autovacuum_tuple_relid
(
Relation
avRel
,
Oid
relid
)
{
ScanKeyData
entry
[
1
];
SysScanDesc
avScan
;
HeapTuple
avTup
;
ScanKeyInit
(
&
entry
[
0
],
Anum_pg_autovacuum_vacrelid
,
BTEqualStrategyNumber
,
F_OIDEQ
,
ObjectIdGetDatum
(
relid
));
avScan
=
systable_beginscan
(
avRel
,
AutovacuumRelidIndexId
,
true
,
SnapshotNow
,
1
,
entry
);
avTup
=
systable_getnext
(
avScan
);
if
(
HeapTupleIsValid
(
avTup
))
avTup
=
heap_copytuple
(
avTup
);
systable_endscan
(
avScan
);
return
avTup
;
}
/*
/*
* test_rel_for_autovac
* test_rel_for_autovac
*
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录