Make TransactionIdIsInProgress check transam.c's single-item XID status cache
Tom Lane <tgl@sss.pgh.pa.us>
Make TransactionIdIsInProgress check transam.c's single-item XID status cache before it goes groveling through the ProcArray. In situations where the same recently-committed transaction ID is checked repeatedly by tqual.c, this saves a lot of shared-memory searches. And it's cheap enough that it shouldn't hurt noticeably when it doesn't help. Concept and patch by Simon, some minor tweaking and comment-cleanup by Tom.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/transam.c | modified | +48 −29 |
| src/backend/storage/ipc/procarray.c | modified | +17 −2 |
| src/include/access/transam.h | modified | +2 −1 |