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

Commitcea3d55

Browse files
committed
Remove PROC_IN_ANALYZE and derived flags
These flags are unused and always have been.Discussion:https://postgr.es/m/20200805235549.GA8118@alvherre.pgsql
1 parent6f0b632 commitcea3d55

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

‎src/backend/commands/analyze.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,8 @@ analyze_rel(Oid relid, RangeVar *relation,
247247
}
248248

249249
/*
250-
* OK, let's do it. First let other backends know I'm in ANALYZE.
250+
* OK, let's do it. First, initialize progress reporting.
251251
*/
252-
LWLockAcquire(ProcArrayLock,LW_EXCLUSIVE);
253-
MyPgXact->vacuumFlags |=PROC_IN_ANALYZE;
254-
LWLockRelease(ProcArrayLock);
255252
pgstat_progress_start_command(PROGRESS_COMMAND_ANALYZE,
256253
RelationGetRelid(onerel));
257254

@@ -279,14 +276,6 @@ analyze_rel(Oid relid, RangeVar *relation,
279276
relation_close(onerel,NoLock);
280277

281278
pgstat_progress_end_command();
282-
283-
/*
284-
* Reset my PGXACT flag. Note: we need this here, and not in vacuum_rel,
285-
* because the vacuum flag is cleared by the end-of-xact code.
286-
*/
287-
LWLockAcquire(ProcArrayLock,LW_EXCLUSIVE);
288-
MyPgXact->vacuumFlags &= ~PROC_IN_ANALYZE;
289-
LWLockRelease(ProcArrayLock);
290279
}
291280

292281
/*

‎src/include/storage/proc.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,14 @@ struct XidCache
5252
*/
5353
#definePROC_IS_AUTOVACUUM0x01/* is it an autovac worker? */
5454
#definePROC_IN_VACUUM0x02/* currently running lazy vacuum */
55-
#definePROC_IN_ANALYZE0x04/* currently running analyze */
5655
#definePROC_VACUUM_FOR_WRAPAROUND0x08/* set by autovac only */
5756
#definePROC_IN_LOGICAL_DECODING0x10/* currently doing logical
5857
* decoding outside xact */
5958
#definePROC_RESERVED0x20/* reserved for procarray */
6059

6160
/* flags reset at EOXact */
6261
#definePROC_VACUUM_STATE_MASK \
63-
(PROC_IN_VACUUM |PROC_IN_ANALYZE |PROC_VACUUM_FOR_WRAPAROUND)
62+
(PROC_IN_VACUUM | PROC_VACUUM_FOR_WRAPAROUND)
6463

6564
/*
6665
* We allow a small number of "weak" relation locks (AccessShareLock,

‎src/include/storage/procarray.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
*/
3030
#definePROCARRAY_VACUUM_FLAG0x02/* currently running lazy
3131
* vacuum */
32-
#definePROCARRAY_ANALYZE_FLAG0x04/* currently running
33-
* analyze */
3432
#definePROCARRAY_LOGICAL_DECODING_FLAG 0x10/* currently doing logical
3533
* decoding outside xact */
3634

@@ -42,18 +40,13 @@
4240
* have no corresponding PROC flag equivalent.
4341
*/
4442
#definePROCARRAY_PROC_FLAGS_MASK(PROCARRAY_VACUUM_FLAG | \
45-
PROCARRAY_ANALYZE_FLAG | \
4643
PROCARRAY_LOGICAL_DECODING_FLAG)
4744

4845
/* Use the following flags as an input "flags" to GetOldestXmin function */
4946
/* Consider all backends except for logical decoding ones which manage xmin separately */
5047
#definePROCARRAY_FLAGS_DEFAULTPROCARRAY_LOGICAL_DECODING_FLAG
5148
/* Ignore vacuum backends */
5249
#definePROCARRAY_FLAGS_VACUUMPROCARRAY_FLAGS_DEFAULT | PROCARRAY_VACUUM_FLAG
53-
/* Ignore analyze backends */
54-
#definePROCARRAY_FLAGS_ANALYZEPROCARRAY_FLAGS_DEFAULT | PROCARRAY_ANALYZE_FLAG
55-
/* Ignore both vacuum and analyze backends */
56-
#definePROCARRAY_FLAGS_VACUUM_ANALYZEPROCARRAY_FLAGS_DEFAULT | PROCARRAY_VACUUM_FLAG | PROCARRAY_ANALYZE_FLAG
5750

5851
externSizeProcArrayShmemSize(void);
5952
externvoidCreateSharedProcArray(void);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp