Skip to content

Instantly share code, notes, and snippets.

View saurabhs13's full-sized avatar
🎯
Focusing

Saurabh Sethia saurabhs13

🎯
Focusing
View GitHub Profile

WAL File Structure (Simplified)

Field Description
LSN (Log Sequence Number) Unique ID for the record, defines ordering.
CRC (Cyclic Redundancy Check) Used to detect corruption in the record.
Operation Data Actual change (e.g., INSERT, UPDATE, DELETE).
Previous Record LSN Pointer to the last WAL record, forming a chain.
Unicode Range Bit Count Byte Sequence
U+0000 β†’ U+007F 7 0xxxxxxx
U+0080 β†’ U+07FF 11 110xxxxx 10xxxxxx
U+0800 β†’ U+FFFF 16 1110xxxx 10xxxxxx 10xxxxxx
U+10000 β†’ U+10FFFF 21 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
  • Here, x bits are the actual Unicode code point bits.