Various micro-optimizations for GetSnapshopData().
authorRobert Haas <rhaas@postgresql.org>
Sat, 17 Dec 2011 02:44:26 +0000 (21:44 -0500)
committerRobert Haas <rhaas@postgresql.org>
Sat, 17 Dec 2011 02:48:47 +0000 (21:48 -0500)
commit0d76b60db4684d3487223b003833828fe9655fe2
treedcc31473e3337aea78d31c0c7f4edb42041a3adb
parenta4cd6abcc901c1a8009c62a27f78696717bb8fe1
Various micro-optimizations for GetSnapshopData().

Heikki Linnakangas had the idea of rearranging GetSnapshotData to
avoid checking for sub-XIDs when no top-level XID is present.  This
patch does that plus further a bit of further, related rearrangement.
Benchmarking show a significant improvement on unlogged tables at
higher concurrency levels, and mostly indifferent result on permanent
tables (which are presumably bottlenecked elsewhere).  Most of the
benefit seems to come from using the new NormalTransactionIdPrecedes()
macro rather than the function call TransactionIdPrecedes().
src/backend/storage/ipc/procarray.c
src/include/access/transam.h