The Lookaside Table (LAS) & Cache Pressure Overflow
The WiredTiger Lookaside Table (LAS) acts as an overflow swap area on disk for old transaction updates when the in-memory cache experiences extreme pressure.
WiredTiger Storage Engine: Cache, Journal & Checkpoints
Simulate RAM page states, dirty page eviction thresholds, WAL journaling, and 60-second checkpoint disk flushes.
1. Formal Definition & Architecture Intent
The Lookaside Table (WiredTigerLAS.wt) is a specialized on-disk file used by WiredTiger during intense memory cache pressure. When an active page needs to be evicted to free RAM, but that page contains uncommitted modifications or updates required by older concurrent transactions, WiredTiger writes those historical version deltas into the Lookaside Table.
2. Explain Like I'm 5 (Mental Model)
Imagine your desk is overflowing with papers. You need to clear space, but some old documents belong to a colleague who is still on vacation. Instead of throwing them away or keeping them on your desk, you move them into a temporary storage locker in the hallway (the Lookaside table).
3. Real-World Architecture Example
A long-running report running for 45 minutes while thousands of concurrent updates modify the same records.
{
"lookaside table entries allocated": 250000,
"lookaside table inserts": 180000,
"lookaside table lookups": 95000
}WiredTiger spills old version tuples to the LAS file so it can evict the parent pages from RAM without breaking the long-running query.
4. MQL Implementation Steps
const las = db.serverStatus().wiredTiger["lookaside table"];
print("LAS Inserts: " + las["lookaside table inserts"]);
print("LAS Lookups: " + las["lookaside table lookups"]);5. Critical Engineering Rules
| Rule / Constraint | Underlying Reason & Impact |
|---|---|
| Trigger Cause | Active cache eviction coupled with long-running transactions holding old snapshot timestamps. |
| Performance Warning | When queries must read from the Lookaside table, read latency degrades drastically due to random disk reads. |
6. Deep Dive: How Long-Running Queries Drive LAS Spilling
Under MVCC, every update creates a new row version while preserving the old version for concurrent readers. If a transaction opens a snapshot at timestamp T0 and runs for 1 hour, WiredTiger CANNOT discard any row versions modified after T0. When cache pressure demands page eviction, WiredTiger has no choice but to write these historical versions into WiredTigerLAS.wt on disk.
// Find long-running operations pinning historical snapshots:
db.currentOp({ "secs_running": { $gt: 300 } });7. Architectural Trade-offs
- •Prevents out-of-memory (OOM) crashes during severe cache starvation
- •Allows long-running analytical queries to finish without failing with snapshot isolation errors
- •High disk I/O latency when queries must probe the on-disk LAS table to reconstruct snapshots
- •Excessive LAS usage indicates that system RAM is undersized for the workload
8. Technical Interview Questions
High LAS activity is triggered when long-running read operations or uncommitted transactions pin old snapshot timestamps, preventing the engine from purging dead MVCC row versions, while concurrent write traffic forces the cache eviction server to spill these uncommitted or historical deltas to the LAS file on disk.
9. Staff-Level Ready Answer
"The Lookaside Table (LAS) is WiredTiger's overflow swap file for MVCC historical versions. When the cache is full and pages must be evicted, but contain row versions required by active older transactions, those versions are written to the LAS file on disk to prevent OOM errors."
10. Quick Knowledge Check
Which metric in db.serverStatus() indicates that WiredTiger is swapping historical MVCC versions to disk?