aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/explain.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-01-17 01:14:32 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-01-17 01:15:23 +0200
commit94028691609f8e148bd4ce72c46163f018832a5b (patch)
treeb27e0466f02336d5dad3f2594942e9a4cc23b4c2 /src/backend/commands/explain.c
parent779fdcdeeeb9cdbfd271f8dc5bde76ed0c7b0813 (diff)
downloadpostgresql-94028691609f8e148bd4ce72c46163f018832a5b.tar.gz
postgresql-94028691609f8e148bd4ce72c46163f018832a5b.zip
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.
Diffstat (limited to 'src/backend/commands/explain.c')
0 files changed, 0 insertions, 0 deletions