Overview of bitmap functions
Bitmap functions are a set of specialized functions provided in the seekdb system for efficiently handling compressed bitmap data. These functions allow users to perform complex bitmap queries and analyses at the database level, enabling efficient storage, querying, and manipulation of bitmap data for applications such as user behavior analysis, user profiling, and audience targeting.
Here is an overview of the types of bitmap functions in seekdb and their purposes:
Types of bitmap functions
| Bitmap Function Type | Description |
|---|---|
| Bitmap Constructor Functions | Functions for constructing new bitmap data types. |
| Bitmap Cardinality Calculation Functions | Functions for calculating the cardinality of bitmap data. |
| Bitmap Operation Functions | Functions for performing basic operations on bitmap data, such as intersection, union, XOR, and AND NOT. |
| Bitmap Decision Functions | Functions for making decisions based on input bitmap data and returning boolean values. |
| Bitmap Output Functions | Functions for selecting the output format of bitmap data, such as outputting each element of the bitmap data as a string separated by commas. |
| Bitmap Aggregate Functions | Functions for aggregating numeric data into bitmap data, i.e., performing aggregate operations on bitmap data. |
Full list of bitmap functions
The following table lists all the bitmap functions supported by seekdb:
| Function Type | Function Name | Description |
|---|---|---|
| Bitmap Constructor Function | rb_build_empty | Constructs an empty bitmap data. |
| Bitmap Constructor Function | rb_build_empty | Constructs an empty bitmap data. |
| Bitmap Constructor Function | rb_build_varbinary | Constructs bitmap data using varbinary. |
| Bitmap Constructor Function | rb_from_string | Constructs bitmap data using a string in a specific format. |
| Bitmap Constructor Function | rb_select | Selects a local range from bitmap data values based on specified conditions, saves it as new bitmap data, and returns its value. |
| Bitmap Cardinality Calculation Function | rb_cardinality | Calculates the cardinality of bitmap data. |
| Bitmap Cardinality Calculation Function | rb_and_cardinality and rb_and_null2empty_cardinality | Returns the cardinality of the new bitmap data obtained after performing an AND operation on two bitmap data sets. |
| Bitmap Cardinality Calculation Function | rb_or_cardinality and rb_or_null2empty_cardinality | Returns the cardinality of the new bitmap data obtained after performing an OR operation on two bitmap data sets. |
| Bitmap Cardinality Calculation Function | rb_xor_cardinality | Returns the cardinality of the new bitmap data obtained after performing an XOR operation on two bitmap data sets. |
| Bitmap Cardinality Calculation Function | rb_andnot_cardinality and rb_andnot_null2empty_cardinality | Returns the cardinality of the new bitmap data obtained after performing an AND NOT operation on two bitmap data sets. |
| Bitmap Cardinality Calculation Function | rb_or_cardinality_agg | Calculates the cardinality of the union of a bitmap column. |
| Bitmap Cardinality Calculation Function | rb_and_cardinality_agg | Calculates the cardinality of the intersection of a bitmap column. |
| Bitmap Operation Function | rb_and and rb_and_null2empty | Calculates the intersection of two bitmap data sets. |
| Bitmap Operation Function | rb_or and rb_or_null2empty | Calculates the union of two bitmap data sets. |
| Bitmap Operation Function | rb_xor | Performs an XOR operation on two bitmap data sets. |
| Bitmap Operation Function | rb_andnot and rb_andnot_null2empty | Performs an AND NOT operation on two bitmap data sets. |
| Bitmap Decision Function | rb_is_empty | Checks whether the input bitmap data is empty. |
| Bitmap Decision Function | rb_contains | Two uses:
|
| Bitmap Output Function | rb_to_varbinary | Outputs bitmap data in varbinary format. |
| Bitmap Output Function | rb_to_string | Outputs each element of the bitmap data as a string, separated by commas. |
| Bitmap Output Function | rb_to_array | Outputs bitmap data in array format. |
| Bitmap Aggregate Function | rb_build_agg | Aggregates a numeric column into bitmap data. |
| Bitmap Aggregate Function | rb_or_agg | Performs an OR operation on multiple rows of a bitmap column and aggregates the results into bitmap data. |
| Bitmap Aggregate Function | rb_and_agg | Performs an AND operation on multiple rows of a bitmap column and aggregates the results into bitmap data. |