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

Commit710796f

Browse files
committed
Avoid unnecessary shared invalidations in ROLLBACK PREPARED
The performance gain is minimal, but this makes the logic moreconsistent with AtEOXact_Inval(). No other invalidation is needed inthis case as PREPARE takes already care of sending any local ones.Author: Liu HuailingReviewed-by: Tom Lane, Michael PaquierDiscussion:https://postgr.es/m/OSZPR01MB6215AA84D71EF2B3D354CF86BE139@OSZPR01MB6215.jpnprd01.prod.outlook.com
1 parentc3928b4 commit710796f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

‎src/backend/access/transam/twophase.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,13 +1520,17 @@ FinishPreparedTransaction(const char *gid, bool isCommit)
15201520
* Handle cache invalidation messages.
15211521
*
15221522
* Relcache init file invalidation requires processing both before and
1523-
* after we send the SI messages. See AtEOXact_Inval()
1523+
* after we send the SI messages, only when committing. See
1524+
* AtEOXact_Inval().
15241525
*/
1525-
if (hdr->initfileinval)
1526-
RelationCacheInitFilePreInvalidate();
1527-
SendSharedInvalidMessages(invalmsgs,hdr->ninvalmsgs);
1528-
if (hdr->initfileinval)
1529-
RelationCacheInitFilePostInvalidate();
1526+
if (isCommit)
1527+
{
1528+
if (hdr->initfileinval)
1529+
RelationCacheInitFilePreInvalidate();
1530+
SendSharedInvalidMessages(invalmsgs,hdr->ninvalmsgs);
1531+
if (hdr->initfileinval)
1532+
RelationCacheInitFilePostInvalidate();
1533+
}
15301534

15311535
/*
15321536
* Acquire the two-phase lock. We want to work on the two-phase callbacks

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp