minor fix in CancelVirtualTransaction

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

minor fix in CancelVirtualTransaction

Álvaro Herrera
It looks to me like we're missing a trick in CancelVirtualTransaction --
there's a loop to compare all VXIDs, and we break as soon as find a
perfect match in (backendid, localTransactionId).  However, once we've
found the backendId that matches, it's not possible for there to be
another entry with the same backendId, so we might as well just quit the
loop, even if we don't send a signal.

No, I don't know if this shows in profiles.  I just noticed while
reading code.

Attached patch (git diff --ignore-space-change; needs reindent)
illustrates.  This was added by commit efc16ea52067 (Dec 2009) and seems
unchanged since then.

--
Álvaro Herrera                         Developer, https://www.PostgreSQL.org/

0001-fixup-CancelVirtualTransaction.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: minor fix in CancelVirtualTransaction

Alvaro Herrera-9
Same patch, commit message added.  Adding to commitfest.

--
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

0001-Optimize-CancelVirtualTransaction-a-little-bit.patch (2K) Download Attachment