OceanBase Database supports the Roaring bitmap data type, which can be used to store and process a group of unsigned integers, namely, non-negative integers.
A Roaring bitmap is used to quickly process a large amount of data. It has the following benefits:
- High space efficiency: It uses a bit to represent the existence status of an element, which can save much storage space. Such a structure is commonly used in scenarios where a large amount of data needs to be processed, such as data statistics, data deduplication, and data analysis.
- Easy and quick operation: You can conveniently check whether an element exists, add an element, or delete an element at the corresponding bit. This way, you can efficiently query and analyze business data through operations on Roaring bitmaps, such as XOR, intersection, and union operations.
A Roaring bitmap outperforms a conventional bitmap in storing very sparse bit arrays. In some cases, a Roaring bitmap can provide a higher operation speed and better compression effects than a normal bitmap. The operation speed of a Roaring bitmap can be hundreds of times higher than that of a normal bitmap. Moreover, the Roaring bitmap data type can support 64-bit integer data.
Apart from the Roaring bitmap data type, OceanBase Database V4.3.3 also provides functions for operating Roaring bitmap data. For more information, see Roaring bitmap functions.