A deep dive into how RavenDB's Corax querying engine optimizes Posting List processing using a divide-and-conquer approach. Instead of a switch statement that branches per item, the new approach uses the lowest 2 bits of each Posting List ID as a bucket index, partitioning items in a branchless single pass. This enables bulk processing: single-value lists can be decoded and sorted with SIMD, while small Posting Lists can be loaded from disk in a single batched call via Container.GetAll(). The result is tighter loops, fewer branches, and more efficient I/O.
9.1K Impressions