Presence Bitmaps for Count-Distinct Query Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Count-distinct queries on large collections of multi-dimensional data become time-intensive and resource-intensive, particularly in systems handling vast amounts of data, leading to significant delays in query results.
Innovation Solution
The system condenses raw data by aggregating and representing it at different granularities, such as daily, monthly, and yearly levels, using presence bitmaps to eliminate duplicates and support efficient count-distinct queries, allowing for rapid execution of queries against condensed data.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If count-distinct queries are executed on large collections of multi-dimensional data, then accurate results are obtained, but the query execution time becomes excessively long and system resources are heavily consumed
Solution Approach 1:
The patent segments the large data set into multiple partitions based on dimension values (e.g., partitioning telephone numbers by area code). Each partition is processed separately to identify unique keys, and results are aggregated. This segmentation reduces the computational burden on any single processing unit and enables parallel execution, significantly reducing query execution time while maintaining accuracy.
Solution Approach 2:
The patent performs preliminary processing by pre-computing and storing presence bitmaps that indicate the presence of unique keys in different partitions. These bitmaps are prepared in advance and can be quickly queried without re-processing the entire data set. This preliminary action transforms the expensive count-distinct operation into a simple bitmap query, dramatically reducing execution time.
2Measurement precision
If count-distinct queries are executed on large collections of multi-dimensional data, then complete analysis is achieved, but system resource consumption increases significantly
Solution Approach 1:
The patent creates compact bitmap representations (copies) of the presence information for unique keys in each partition. Instead of processing the full multi-dimensional data set during query execution, the system uses these pre-generated bitmap copies that occupy minimal memory. This copying approach maintains complete analysis capability while reducing memory usage and computational resources by several orders of magnitude.
Solution Approach 2:
The patent transforms the data representation from storing actual multi-dimensional records to storing compact bitmap parameters that encode presence information. This parameter change from detailed records to compressed bitmaps dramatically reduces the memory footprint and processing requirements while preserving the ability to accurately determine unique key counts across partitions.
Data Source
AI summary
A system, method, and apparatus are provided for supporting and/or executing count-distinct queries. A large set of data (e.g., tens or hundreds of millions of event records) is condensed daily to generate presence bitmaps to reflect the distinctiveness of a selected data dimension S (e.g., user ID) for one or more key dimensions g1, g2, . . . (e.g., advertisement ID, campaign ID, advertiser ID). The condensation process eliminates duplication and yields a single value (e.g., 1 or 0) for each tuple [S, g1, . . . ] to represent the distinctiveness of each value in the S dimension to each combination of values in the grouping dimensions. On a monthly basis, the daily values are condensed to yield a single value for the month, and a similar process is applied on any other desired time granularities (e.g., year). The condensed data may be generated for any combination of selected dimension(s) and grouping dimension(s).


