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

Commit5fde047

Browse files
committed
Combine two flag tests in GetSnapshotData().
Previously the code checked PROC_IN_LOGICAL_DECODING andPROC_IN_VACUUM separately. As the relevant variable is marked asvolatile, the compiler cannot combine the two tests. AsGetSnapshotData() is pretty hot in a number of workloads, it'sworthwhile to fix that.It'd also be a good idea to get rid of the volatiles altogether. Butfor one that's a larger patch, and for another, the code after thischange still seems at least as easy to read as before.Author: Andres FreundDiscussion:https://postgr.es/m/20181005172955.wyjb4fzcdzqtaxjq@alap3.anarazel.de
1 parent5fc1670 commit5fde047

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

‎src/backend/storage/ipc/procarray.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,14 +1589,11 @@ GetSnapshotData(Snapshot snapshot)
15891589
TransactionIdxid;
15901590

15911591
/*
1592-
*Backend is doing logical decoding which manages xmin
1593-
* separately,check below.
1592+
*Skip over backends doing logical decoding which manages xmin
1593+
* separately (check below) and ones running LAZY VACUUM.
15941594
*/
1595-
if (pgxact->vacuumFlags&PROC_IN_LOGICAL_DECODING)
1596-
continue;
1597-
1598-
/* Ignore procs running LAZY VACUUM */
1599-
if (pgxact->vacuumFlags&PROC_IN_VACUUM)
1595+
if (pgxact->vacuumFlags&
1596+
(PROC_IN_LOGICAL_DECODING |PROC_IN_VACUUM))
16001597
continue;
16011598

16021599
/* Update globalxmin to be the smallest valid xmin */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp