Want to compress and index your data at the same time? Use roaring bitmaps! A bitmap representation of data is surprisingly flexible for computation, and roaring uses some clever tricks to do that with high performance. For additional scalability, try pilosa, a distributed database built on top of roaring (I work for the company that maintains pilosa).
https://roaringbitmap.org/ https://www.pilosa.com/