-
Type:
Task
-
Resolution: Gone away
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Btree
-
None
-
Storage Engines - Transactions
-
787.046
-
SE Transactions - 2026-08-14
-
2
Background
__time_window_clear_obsolete (src/btree/bt_page.c) currently checks start visibility before stop visibility:
if (__wt_txn_tw_start_visible_all(session, tw)) {
tw->start_ts = tw->durable_start_ts = WT_TS_NONE;
tw->start_txn = WT_TXN_NONE;
}
if (__wt_txn_tw_stop_visible_all(session, tw)) {
tw->stop_ts = tw->durable_stop_ts = WT_TS_NONE;
tw->stop_txn = WT_TXN_NONE;
}
Optimization
Check the stop time point first. If the stop is globally visible, the start must also be globally visible (a value cannot be deleted before it is written), so we can clear the entire time window without a separate start visibility check:
if (__wt_txn_tw_stop_visible_all(session, tw)) {
tw->stop_ts = tw->durable_stop_ts = WT_TS_NONE;
tw->stop_txn = WT_TXN_NONE;
/* Stop visible to all implies start is also visible to all. */
tw->start_ts = tw->durable_start_ts = WT_TS_NONE;
tw->start_txn = WT_TXN_NONE;
return;
}
if (__wt_txn_tw_start_visible_all(session, tw)) {
tw->start_ts = tw->durable_start_ts = WT_TS_NONE;
tw->start_txn = WT_TXN_NONE;
}
Benefit
Avoids one redundant visibility check (__wt_txn_tw_start_visible_all) in the common case where the stop is globally visible. The function is called for every cell during page reconciliation, so the saving compounds across workloads with many deleted values.
- fixes
-
WT-18162 Skip materializing globally-visible-deleted keys when reconstructing a disaggregated page from base image + deltas
-
- Closed
-
- is fixed by
-
WT-18087 Invalid argument: value time window has a start time after its stop time
-
- Closed
-
- related to
-
WT-18162 Skip materializing globally-visible-deleted keys when reconstructing a disaggregated page from base image + deltas
-
- Closed
-