{
  "slug": "range-tombstone",
  "term": "Range tombstone",
  "aliases": [
    "range deletion marker"
  ],
  "definition": "A range tombstone is a versioned deletion marker that suppresses covered older keys across an ordered key interval.",
  "note": "RocksDB DeleteRange uses [start, end). In v9.7.3 equal endpoints are empty; reversed endpoints return InvalidArgument under the comparator. [range-api] [range-write] One logged entry goes into a dedicated memtable; insertion costs O(log T) in buffered tombstones, not covered keys. [delete-range]\n\nThe example [c, d)@4, [g, h)@7 and [a, z)@10 produces five disjoint spans with seven sequence-tagged fragments (stacked versions). [delete-range-impl] [range-visibility]\n\nA covering tombstone visible to the read snapshot can stop lower-level searches. The current table is still checked for newer point values and pending merge operands are resolved. [delete-range-impl] [range-visibility] [range-table]\n\nThe 2018 benchmark used 5 million keys, 10,000 tombstones and 10 runs, with the database in block cache. Point lookups took 0.6128 µs with fragmentation, 1.3179 µs unfragmented and 0.6036 µs after per-key scan-and-delete. Scans of up to 10 keys took 2.8226, 6.23 and 2.6844 µs respectively. These are that experiment's results, not universal latency estimates. [delete-range]\n\nPhysical cleanup is separate and snapshot-sensitive. Range tombstones occupy SST meta-blocks and are truncated at file boundaries; compaction handles covered versions within snapshot stripes. [delete-range] [delete-range-impl]\n\nDeleteFilesInRange instead selects whole files, with different snapshot and endpoint rules. [file-api]\n\nRange conversion at commit 94c7f76da0ba preserves the iterator sequence and retains point markers. Partial read views can disable it; read-write table_filter iterators are rejected when enabled. [conversion-options] [conversion-iterator]\n\nA finite model separates hidden live keys, sequence changes and premature marker removal; it is not engine execution. [conversion-model]",
  "related": [
    "lsm-tombstone",
    "lsm-tree",
    "sstable",
    "rocksdb-delete-files-in-range",
    "secondary-range-delete",
    "gloran"
  ],
  "citations": [
    {
      "id": "delete-range",
      "title": "Abhishek Madan and Andrew Kryczka. DeleteRange: A New Native RocksDB Operation. RocksDB blog, 21 November 2018, including benchmark tables.",
      "url": "https://rocksdb.org/blog/2018/11/21/delete-range.html",
      "accessed": "2026-10-22"
    },
    {
      "id": "hesela",
      "title": "LSM tombstones: deleted is not yet reclaimed",
      "url": "https://hesela.com/analyses/lsm-tombstones-delete-persistence/",
      "accessed": "2026-10-12"
    },
    {
      "id": "delete-range-impl",
      "title": "RocksDB wiki: DeleteRange Implementation (tombstone fragments, read path, compaction and truncation)",
      "url": "https://github.com/facebook/rocksdb/wiki/DeleteRange-Implementation",
      "accessed": "2026-10-22"
    },
    {
      "id": "range-api",
      "title": "RocksDB v9.7.3. db.h: DeleteRange endpoint contract.",
      "url": "https://github.com/facebook/rocksdb/blob/v9.7.3/include/rocksdb/db.h",
      "accessed": "2026-10-23"
    },
    {
      "id": "range-write",
      "title": "RocksDB v9.7.3. WriteBatch memtable insertion: equal and reversed DeleteRange bounds.",
      "url": "https://github.com/facebook/rocksdb/blob/v9.7.3/db/write_batch.cc",
      "accessed": "2026-10-23"
    },
    {
      "id": "file-api",
      "title": "RocksDB v9.7.3. convenience.h: DeleteFilesInRange contract.",
      "url": "https://github.com/facebook/rocksdb/blob/v9.7.3/include/rocksdb/convenience.h",
      "accessed": "2026-10-23"
    },
    {
      "id": "range-visibility",
      "title": "RocksDB v9.7.3. FragmentedRangeTombstoneIterator: snapshot visibility and version stacks.",
      "url": "https://github.com/facebook/rocksdb/blob/v9.7.3/db/range_tombstone_fragmenter.h",
      "accessed": "2026-10-23"
    },
    {
      "id": "range-table",
      "title": "RocksDB v9.7.3. TableCache::Get: range tombstone and point-value lookup.",
      "url": "https://github.com/facebook/rocksdb/blob/v9.7.3/db/table_cache.cc",
      "accessed": "2026-10-23"
    },
    {
      "id": "conversion-options",
      "title": "RocksDB commit 94c7f76da0ba751f1b686f43f4bedb5c58e1dc47. advanced_options.h: experimental conversion, visibility exclusions and table_filter rejection.",
      "url": "https://github.com/facebook/rocksdb/blob/94c7f76da0ba751f1b686f43f4bedb5c58e1dc47/include/rocksdb/advanced_options.h",
      "accessed": "2026-10-23"
    },
    {
      "id": "conversion-iterator",
      "title": "RocksDB commit 94c7f76da0ba751f1b686f43f4bedb5c58e1dc47. db_iter.cc: read-path range conversion and sequence identity.",
      "url": "https://github.com/facebook/rocksdb/blob/94c7f76da0ba751f1b686f43f4bedb5c58e1dc47/db/db_iter.cc",
      "accessed": "2026-10-23"
    },
    {
      "id": "conversion-model",
      "title": "Hesela. Tombstone conversion: finite read-equivalence model, code, tests and explicit limits.",
      "url": "https://hesela.dev/research/tombstone-conversion/README.md",
      "accessed": "2026-10-23"
    },
    {
      "id": "fragmenter-stacks",
      "title": "RocksDB v9.7.3: FragmentTombstones read-mode retention and snapshot-stripe pruning.",
      "url": "https://github.com/facebook/rocksdb/blob/0e2801ac30b3f283c3b14e523ba3667eca024f09/db/range_tombstone_fragmenter.cc",
      "accessed": "2026-12-04"
    },
    {
      "id": "native-stacks",
      "title": "Hesela. Native range-tombstone stack counts: probe, independent oracle and 780 cases.",
      "url": "https://hesela.dev/research/range-tombstone-stacks/README.md",
      "accessed": "2026-12-04"
    }
  ],
  "status": "shipping",
  "advantages": [
    {
      "text": "Deleting a key range costs one logged write instead of a scan that reads and deletes every covered key.",
      "citationIds": [
        "delete-range"
      ]
    }
  ],
  "limitations": [
    {
      "text": "Very long range scans can be slower than after per-key deletes, because each memtable and file keeps its own tombstone iterator.",
      "citationIds": [
        "delete-range"
      ]
    },
    {
      "text": "For 256 nested ranges with distinct sequences, the v9.7.3 native fragmenter retains 511 spans but 65536 sequence entries in read mode; compaction without snapshots retains 511 entries. These component counts are not allocated bytes or lookup timings.",
      "citationIds": [
        "native-stacks",
        "fragmenter-stacks"
      ]
    }
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-12-04",
  "provenance": [
    "delete-range is the November 2018 post by Madan and Kryczka (Meta), reread in full on the access date, including the benchmark tables.",
    "delete-range-impl is the engine's DeleteRange implementation wiki page, read in full for fragmentation, the read path, compaction and truncation.",
    "5 million keys, 10,000 tombstones, 10 runs and the 0.6128, 1.3179, 0.6036, 2.8226, 6.23 and 2.6844 µs values come from delete-range. The seven-fragment example comes from delete-range-impl. The endpoint acceptance rule is corrected against the versioned API and insertion path.",
    "Endpoint correction: the wiki's set-theoretic empty-range description does not replace the v9.7.3 API error contract. [range-api] [range-write]",
    "Source-review correction: distinguish disjoint spans from stacked sequence versions and require read visibility before interpreting a covering tombstone.",
    "Conversion supplement reviewed against pinned source commit 94c7f76da0ba751f1b686f43f4bedb5c58e1dc47. Original educational model is separately labeled; no native engine execution.",
    "Native v9.7.3 fragment-list observation: 780 in-memory cases across three interval shapes and four retention modes. Every endpoint and sequence matched an independent oracle. No user-defined timestamps, duplicate sequences, database workload or timing measurements. [native-stacks]"
  ]
}
