# Evaluating Equality Predicates with RangeBitmap

DevFeed: [Evaluating Equality Predicates with RangeBitmap](<https://devfeed.tech/articles/evaluating-equality-predicates-25641.md>)

Original publisher: [Read original article](<https://richardstartin.github.io/posts/range-bitmap-equality-queries>)

Author: Richard Startin's Blog

Published: 2022-12-18T00:00:00Z

Content type: article

Language: en

Sources: [Richard Startin's Blog](<https://devfeed.tech/sources/richard-startin-s-blog.md>)

Topics: [Data structures](<https://devfeed.tech/topics/data-structures.md>), [Library](<https://devfeed.tech/topics/library.md>), [benchmarking](<https://devfeed.tech/topics/benchmarking.md>), [data observability](<https://devfeed.tech/topics/data-observability.md>)

Tags: [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [cardinality](<https://devfeed.tech/tags/cardinality.md>), [comparison](<https://devfeed.tech/tags/comparison.md>), [data-engineering](<https://devfeed.tech/tags/data-engineering.md>), [data-structure](<https://devfeed.tech/tags/data-structure.md>), [java](<https://devfeed.tech/tags/java.md>), [library](<https://devfeed.tech/tags/library.md>), [memory](<https://devfeed.tech/tags/memory.md>), [pinot](<https://devfeed.tech/tags/pinot.md>), [range](<https://devfeed.tech/tags/range.md>), [roaring](<https://devfeed.tech/tags/roaring.md>), [speed](<https://devfeed.tech/tags/speed.md>)

## AI overview

This article evaluates equality and inequality queries using RangeBitmap in the RoaringBitmap library. It explains how the enhancement can support equality filtering as a compact inverted-index alternative, including as a fallback for Apache Pinot range indexes, and reports faster selection than a stream-based scan in the described example while using less space than some inverted indexes.

## Source excerpt

I have just implemented support for (in)equality queries against a RangeBitmap, a succinct data structure in the RoaringBitmap library which supports range queries. RangeBitmap was designed to support range queries in Apache Pinot (more details here) but this enhancement would allow a range index to be used as a fallback for (in)equality queries in case nothing better is available. Supporting (in)equality queries allows a RangeBitmap to be used as a kind of compact inverted index, trading space for time, capable of supporting high cardinality gracefully. Since RangeBitmap supports memory mapping from files, I think that it could be used for data engineering beyond Apache Pinot.