]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Implement lazy XID allocation: transactions that do not modify any database
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 5 Sep 2007 18:10:48 +0000 (18:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 5 Sep 2007 18:10:48 +0000 (18:10 +0000)
commit295e63983d7596ccc5717ff4a0a235ba241a2614
treed4d8baaed4992dab3a4ae5110f765237da136cb3
parent2e74c53ec1103f92c5704d87a4af2ab573402212
Implement lazy XID allocation: transactions that do not modify any database
rows will normally never obtain an XID at all.  We already did things this way
for subtransactions, but this patch extends the concept to top-level
transactions.  In applications where there are lots of short read-only
transactions, this should improve performance noticeably; not so much from
removal of the actual XID-assignments, as from reduction of overhead that's
driven by the rate of XID consumption.  We add a concept of a "virtual
transaction ID" so that active transactions can be uniquely identified even
if they don't have a regular XID.  This is a much lighter-weight concept:
uniqueness of VXIDs is only guaranteed over the short term, and no on-disk
record is made about them.

Florian Pflug, with some editorialization by Tom.
34 files changed:
doc/src/sgml/catalogs.sgml
doc/src/sgml/config.sgml
src/backend/access/heap/heapam.c
src/backend/access/transam/README
src/backend/access/transam/clog.c
src/backend/access/transam/multixact.c
src/backend/access/transam/twophase.c
src/backend/access/transam/xact.c
src/backend/access/transam/xlog.c
src/backend/catalog/system_views.sql
src/backend/commands/indexcmds.c
src/backend/commands/sequence.c
src/backend/commands/vacuum.c
src/backend/commands/vacuumlazy.c
src/backend/storage/ipc/procarray.c
src/backend/storage/ipc/sinvaladt.c
src/backend/storage/lmgr/lmgr.c
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/proc.c
src/backend/storage/smgr/smgr.c
src/backend/utils/adt/lockfuncs.c
src/backend/utils/error/elog.c
src/backend/utils/misc/postgresql.conf.sample
src/include/access/xact.h
src/include/access/xlog.h
src/include/c.h
src/include/catalog/catversion.h
src/include/storage/lmgr.h
src/include/storage/lock.h
src/include/storage/proc.h
src/include/storage/procarray.h
src/include/storage/sinvaladt.h
src/include/storage/smgr.h
src/test/regress/expected/rules.out