Make some simple performance improvements in TransactionIdIsInProgress().
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 21 Sep 2007 17:36:53 +0000 (17:36 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 21 Sep 2007 17:36:53 +0000 (17:36 +0000)
commit3e55d0e2b121259e9dc2ffcfd49f3e1e8000202b
tree46a968b9d328eb9221ff247b6614756c16503c1a
parent382d50b723ecc24bdea648f4152cd2b3fd538480
Make some simple performance improvements in TransactionIdIsInProgress().
For XIDs of our own transaction and subtransactions, it's cheaper to ask
TransactionIdIsCurrentTransactionId() than to look in shared memory.
Also, the xids[] work array is always the same size within any given
process, so malloc it just once instead of doing a palloc/pfree on every
call; aside from being faster this lets us get rid of some goto's, since
we no longer have any end-of-function pfree to do.  Both ideas by Heikki.
src/backend/storage/ipc/procarray.c