Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbff258a

Browse files
committed
pgstat: rename pgstat_initstats() to pgstat_relation_init().
The old name was overly generic. An upcoming commit moves relation statshandling into its own file, making pgstat_initstats() look even more out ofplace.Author: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/20220303021600.hs34ghqcw6zcokdh@alap3.anarazel.de
1 parent8363102 commitbff258a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎src/backend/access/common/relation.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ relation_open(Oid relationId, LOCKMODE lockmode)
7373
if (RelationUsesLocalBuffers(r))
7474
MyXactFlags |=XACT_FLAGS_ACCESSEDTEMPNAMESPACE;
7575

76-
pgstat_initstats(r);
76+
pgstat_relation_init(r);
7777

7878
returnr;
7979
}
@@ -123,7 +123,7 @@ try_relation_open(Oid relationId, LOCKMODE lockmode)
123123
if (RelationUsesLocalBuffers(r))
124124
MyXactFlags |=XACT_FLAGS_ACCESSEDTEMPNAMESPACE;
125125

126-
pgstat_initstats(r);
126+
pgstat_relation_init(r);
127127

128128
returnr;
129129
}

‎src/backend/postmaster/pgstat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ static bool pgStatRunningInCollector = false;
188188
* for the life of the backend. Also, we zero out the t_id fields of the
189189
* contained PgStat_TableStatus structs whenever they are not actively in use.
190190
* This allows relcache pgstat_info pointers to be treated as long-lived data,
191-
* avoiding repeated searches inpgstat_initstats() when a relation is
191+
* avoiding repeated searches inpgstat_relation_init() when a relation is
192192
* repeatedly opened during a transaction.
193193
*/
194194
#defineTABSTAT_QUANTUM100/* we alloc this many at a time */
@@ -2147,7 +2147,7 @@ pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu, bool finalize)
21472147

21482148

21492149
/* ----------
2150-
*pgstat_initstats() -
2150+
*pgstat_relation_init() -
21512151
*
21522152
*Initialize a relcache entry to count access statistics.
21532153
*Called whenever a relation is opened.
@@ -2159,7 +2159,7 @@ pgstat_end_function_usage(PgStat_FunctionCallUsage *fcu, bool finalize)
21592159
* ----------
21602160
*/
21612161
void
2162-
pgstat_initstats(Relationrel)
2162+
pgstat_relation_init(Relationrel)
21632163
{
21642164
Oidrel_id=rel->rd_id;
21652165
charrelkind=rel->rd_rel->relkind;

‎src/include/pgstat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ extern void pgstat_initialize(void);
11021102
externPgStat_TableStatus*find_tabstat_entry(Oidrel_id);
11031103
externPgStat_BackendFunctionEntry*find_funcstat_entry(Oidfunc_id);
11041104

1105-
externvoidpgstat_initstats(Relationrel);
1105+
externvoidpgstat_relation_init(Relationrel);
11061106

11071107
#definepgstat_relation_should_count(rel) \
11081108
(likely((rel)->pgstat_info != NULL))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp