@@ -50,13 +50,15 @@ typedef enum SnapshotType
50
50
SNAPSHOT_MVCC = 0 ,
51
51
52
52
/*-------------------------------------------------------------------------
53
- * A tuple is visible iff the tuple is valid including effects of open
54
- * transactions.
53
+ * A tuple is visible iff the tuple is valid "for itself".
55
54
*
56
55
* Here, we consider the effects of:
57
- * - all committed and in-progress transactions (as of the current instant)
56
+ * - all committed transactions (as of the current instant)
58
57
* - previous commands of this transaction
59
58
* - changes made by the current command
59
+ *
60
+ * Does _not_ include:
61
+ * - in-progress transactions (as of the current instant)
60
62
* -------------------------------------------------------------------------
61
63
*/
62
64
SNAPSHOT_SELF ,
@@ -79,6 +81,22 @@ typedef enum SnapshotType
79
81
* - all committed and in-progress transactions (as of the current instant)
80
82
* - previous commands of this transaction
81
83
* - changes made by the current command
84
+ *
85
+ * This is essentially like SNAPSHOT_SELF as far as effects of the current
86
+ * transaction and committed/aborted xacts are concerned. However, it
87
+ * also includes the effects of other xacts still in progress.
88
+ *
89
+ * A special hack is that when a snapshot of this type is used to
90
+ * determine tuple visibility, the passed-in snapshot struct is used as an
91
+ * output argument to return the xids of concurrent xacts that affected
92
+ * the tuple. snapshot->xmin is set to the tuple's xmin if that is
93
+ * another transaction that's still in progress; or to
94
+ * InvalidTransactionId if the tuple's xmin is committed good, committed
95
+ * dead, or my own xact. Similarly for snapshot->xmax and the tuple's
96
+ * xmax. If the tuple was inserted speculatively, meaning that the
97
+ * inserter might still back down on the insertion without aborting the
98
+ * whole transaction, the associated token is also returned in
99
+ * snapshot->speculativeToken. See also InitDirtySnapshot().
82
100
* -------------------------------------------------------------------------
83
101
*/
84
102
SNAPSHOT_DIRTY ,
@@ -92,9 +110,10 @@ typedef enum SnapshotType
92
110
93
111
/*
94
112
* A tuple is visible iff the tuple might be visible to some transaction;
95
- * false if it's surely dead to everyone, ie , vacuumable.
113
+ * false if it's surely dead to everyone, i.e. , vacuumable.
96
114
*
97
- * Snapshot.xmin must have been set up with the xmin horizon to use.
115
+ * For visibility checks snapshot->min must have been set up with the xmin
116
+ * horizon to use.
98
117
*/
99
118
SNAPSHOT_NON_VACUUMABLE
100
119
} SnapshotType ;
0 commit comments