summaryrefslogtreecommitdiff
path: root/src/backend/commands/vacuum.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-09-05 18:10:48 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-09-05 18:10:48 +0000
commit295e63983d7596ccc5717ff4a0a235ba241a2614 (patch)
treed4d8baaed4992dab3a4ae5110f765237da136cb3 /src/backend/commands/vacuum.c
parent2e74c53ec1103f92c5704d87a4af2ab573402212 (diff)
downloadpostgresql-295e63983d7596ccc5717ff4a0a235ba241a2614.tar.gz
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.
Diffstat (limited to 'src/backend/commands/vacuum.c')
-rw-r--r--src/backend/commands/vacuum.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c
index 358e9a5ad9..87cf57daec 100644
--- a/src/backend/commands/vacuum.c
+++ b/src/backend/commands/vacuum.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.355 2007/08/13 19:08:26 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.356 2007/09/05 18:10:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2601,14 +2601,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
PageSetLSN(page, recptr);
PageSetTLI(page, ThisTimeLineID);
}
- else
- {
- /*
- * No XLOG record, but still need to flag that XID exists on
- * disk
- */
- MyXactMadeTempRelUpdate = true;
- }
END_CRIT_SECTION();
@@ -2761,13 +2753,6 @@ move_chain_tuple(Relation rel,
PageSetLSN(dst_page, recptr);
PageSetTLI(dst_page, ThisTimeLineID);
}
- else
- {
- /*
- * No XLOG record, but still need to flag that XID exists on disk
- */
- MyXactMadeTempRelUpdate = true;
- }
END_CRIT_SECTION();
@@ -2868,13 +2853,6 @@ move_plain_tuple(Relation rel,
PageSetLSN(dst_page, recptr);
PageSetTLI(dst_page, ThisTimeLineID);
}
- else
- {
- /*
- * No XLOG record, but still need to flag that XID exists on disk
- */
- MyXactMadeTempRelUpdate = true;
- }
END_CRIT_SECTION();
@@ -3070,11 +3048,6 @@ vacuum_page(Relation onerel, Buffer buffer, VacPage vacpage)
PageSetLSN(page, recptr);
PageSetTLI(page, ThisTimeLineID);
}
- else
- {
- /* No XLOG record, but still need to flag that XID exists on disk */
- MyXactMadeTempRelUpdate = true;
- }
END_CRIT_SECTION();
}