Re: Storing hot members of PGPROC out of the band
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Simon Riggs <simon@2ndquadrant.com>, Pavan Deolasee <pavan.deolasee@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2011-11-07T12:28:57Z
Lists: pgsql-hackers
On Mon, Nov 7, 2011 at 6:45 AM, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote: > While looking at GetSnapshotData(), it occurred to me that when a PGPROC > entry does not have its xid set, ie. xid == InvalidTransactionId, it's > pointless to check the subxid array for that proc. If a transaction has no > xid, none of its subtransactions can have an xid either. That's a trivial > optimization, see attached. I tested this with "pgbench -S -M prepared -c > 500" on the 8-core box, and it seemed to make a 1-2% difference (without the > other patch). So, almost in the noise, but it also doesn't cost us anything > in terms of readability or otherwise. Oh, that's a good idea. +1 for doing that now, and then we can keep working on the rest of it. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company