Study Vault Search notes, aliases and full text
Graph
ConceptDBISAI-written · not yet proofread

Gap Encoding

Gap encoding stores a sorted list as its first element followed by the differences between consecutive elements, which are small numbers that a variable-length integer code compresses well.

Know these firstInverted Index

Properties#

  • Particularly effective for the sorted inverted lists (List Intersection needs them sorted): the more frequent a word, the denser its list and the smaller the gaps, so few bits per posting.
  • Lists must be decoded sequentially (prefix sums) to reach an element.

Example#

1,10,11,20,21,30,31,401, 10, 11, 20, 21, 30, 31, 40 becomes 1,9,1,9,1,9,1,91, 9, 1, 9, 1, 9, 1, 9 (DBIS Exam WS1314 (not published), Task 1.1). For the entropy-optimal code of the gaps (two values with probability 12\tfrac12 each, lengths 1 bit) see Entropy-Optimal Code.

Sources#

Search

Type In
↑ ↓ move ↵ open ⇥ next section Ctrl↵ results page Prefix # to search text only