]> granicus.if.org Git - postgresql/commitdiff
Try to save a kernel call in ResolveRecoveryConflictWithVirtualXIDs.
authorRobert Haas <rhaas@postgresql.org>
Fri, 17 Dec 2010 16:32:02 +0000 (11:32 -0500)
committerRobert Haas <rhaas@postgresql.org>
Fri, 17 Dec 2010 16:32:02 +0000 (11:32 -0500)
If there's no work to be done, just exit quickly, before initialization.

src/backend/storage/ipc/standby.c

index 4f209eab68896f2006e8a8459ad11ba6cfc7ebf5..b659c320585c9aef6302c0723dc29ff1c16354db 100644 (file)
@@ -193,6 +193,10 @@ ResolveRecoveryConflictWithVirtualXIDs(VirtualTransactionId *waitlist,
        TimestampTz waitStart;
        char       *new_status;
 
+       /* Fast exit, to avoid a kernel call if there's no work to be done. */
+       if (!VirtualTransactionIdIsValid(*waitlist))
+               return;
+
        waitStart = GetCurrentTimestamp();
        new_status = NULL;              /* we haven't changed the ps display */