postgresql/src/backend
Heikki Linnakangas 9402869160 Advance backend's advertised xmin more aggressively.
Currently, a backend will reset it's PGXACT->xmin value when it doesn't
have any registered snapshots left. That covered the common case that a
transaction in read committed mode runs several queries, one after each
other, as there would be no snapshots active between those queries.
However, if you hold cursors across each of the query, we didn't get a
chance to reset xmin.

To make that better, keep all the registered snapshots in a pairing heap,
ordered by xmin so that it's always quick to find the snapshot with the
smallest xmin. That allows us to advance PGXACT->xmin whenever the oldest
snapshot is deregistered, even if there are others still active.

Per discussion originally started by Jeff Davis back in 2009 and more
recently by Robert Haas.
2015-01-17 01:15:23 +02:00
..
access Fix thinko in re-setting wal_log_hints flag from a parameter-change record. 2015-01-15 20:52:41 +02:00
bootstrap Remove some dead IsUnderPostmaster code from bootstrap.c. 2015-01-14 00:37:02 +01:00
catalog Spell the X072 feature correctly, was missing "with". 2015-01-13 16:08:55 +02:00
commands Rearrange explain.c's API so callers need not embed sizeof(ExplainState). 2015-01-15 13:39:33 -05:00
executor Fix use-of-already-freed-memory problem in EvalPlanQual processing. 2015-01-15 18:52:58 -05:00
foreign Update copyright for 2015 2015-01-06 11:43:47 -05:00
lib Update copyright for 2015 2015-01-06 11:43:47 -05:00
libpq Update copyright for 2015 2015-01-06 11:43:47 -05:00
main Always set the six locale category environment variables in main(). 2015-01-07 22:34:57 -05:00
nodes Improve new caching logic in tbm_add_tuples(). 2015-01-16 13:28:30 -05:00
optimizer Update copyright for 2015 2015-01-06 11:43:47 -05:00
parser Fix get_object_address argument type for extension statement 2015-01-12 15:32:48 -03:00
po Translation updates 2014-12-15 00:25:35 -05:00
port Add barriers to the latch code. 2015-01-13 12:58:43 +01:00
postmaster Add a default local latch for use in signal handlers. 2015-01-14 18:45:22 +01:00
regex Update copyright for 2015 2015-01-06 11:43:47 -05:00
replication Add a default local latch for use in signal handlers. 2015-01-14 18:45:22 +01:00
rewrite Update copyright for 2015 2015-01-06 11:43:47 -05:00
snowball Update copyright for 2015 2015-01-06 11:43:47 -05:00
storage Add a default local latch for use in signal handlers. 2015-01-14 18:45:22 +01:00
tcop Add a default local latch for use in signal handlers. 2015-01-14 18:45:22 +01:00
tsearch Update copyright for 2015 2015-01-06 11:43:47 -05:00
utils Advance backend's advertised xmin more aggressively. 2015-01-17 01:15:23 +02:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
Makefile Update copyright for 2015 2015-01-06 11:43:47 -05:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
nls.mk xlogreader.c: Fix report_invalid_record translatability flag 2015-01-09 12:34:25 -03:00