postgresql/src
Andres Freund 4b4b680c3d Make backend local tracking of buffer pins memory efficient.
Since the dawn of time (aka Postgres95) multiple pins of the same
buffer by one backend have been optimized not to modify the shared
refcount more than once. This optimization has always used a NBuffer
sized array in each backend keeping track of a backend's pins.

That array (PrivateRefCount) was one of the biggest per-backend memory
allocations, depending on the shared_buffers setting. Besides the
waste of memory it also has proven to be a performance bottleneck when
assertions are enabled as we make sure that there's no remaining pins
left at the end of transactions. Also, on servers with lots of memory
and a correspondingly high shared_buffers setting the amount of random
memory accesses can also lead to poor cpu cache efficiency.

Because of these reasons a backend's buffers pins are now kept track
of in a small statically sized array that overflows into a hash table
when necessary. Benchmarks have shown neutral to positive performance
results with considerably lower memory usage.

Patch by me, review by Robert Haas.

Discussion: 20140321182231.GA17111@alap3.anarazel.de
2014-08-30 14:03:21 +02:00
..
backend Make backend local tracking of buffer pins memory efficient. 2014-08-30 14:03:21 +02:00
bin Assorted message improvements 2014-08-29 00:26:17 -04:00
common Small message fixes 2014-08-09 00:07:00 -04:00
include Make backend local tracking of buffer pins memory efficient. 2014-08-30 14:03:21 +02:00
interfaces Install libpq DLL with $(INSTALL_SHLIB). 2014-08-18 23:00:38 -04:00
makefiles Add file version information to most installed Windows binaries. 2014-07-14 14:07:52 -04:00
pl Small message fixes 2014-08-09 00:07:00 -04:00
port Report success when Windows kill() emulation signals an exiting process. 2014-07-23 00:35:13 -04:00
template Remove Alpha and Tru64 support. 2014-06-28 21:46:15 +02:00
test Assorted message improvements 2014-08-29 00:26:17 -04:00
timezone Finish adding file version information to installed Windows binaries. 2014-08-18 22:59:53 -04:00
tools Rework 'MOVE ALL' to 'ALTER .. ALL IN TABLESPACE' 2014-08-21 19:06:17 -04:00
tutorial Adjust blank lines around PG_MODULE_MAGIC defines, for consistency 2014-07-10 14:02:08 -04:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Set shared library path for in-tree TAP tests 2014-08-15 00:01:14 -04:00
Makefile.shlib Remove Alpha and Tru64 support. 2014-06-28 21:46:15 +02:00
nls-global.mk Setup error context callback for transaction lock waits 2014-03-19 15:10:36 -03:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00