HYBRID AGGREGATION OF DATA SETS
The disclosed embodiments provide a system for processing data. During operation, the system obtains one or more filters associated with dimensions of a data set. Next, the system calculates a cardinality associated with the one or more filters. The system then adjusts a level of aggregation of a query associated with the one or more filters based on the cardinality and a query result limit for querying of the data set. Finally, the system uses the query to obtain a set of records from the data set.
1 . A computer-implemented method for processing data, comprising:
obtaining one or more filters associated with dimensions of a data set;
calculating a cardinality associated with the one or more filters;
adjusting a level of aggregation of a query associated with the one or more filters based on the cardinality and a query result limit for querying of the data set; and
using the query to obtain a set of records from the data set.
2 . The computer-implemented method of claim 1 , further comprising:
obtaining an update to the one or more filters; and
upon determining that the update is not included in the set of records obtained using the query, using a new query to obtain a new set of records associated with the update from the data set.
3 . The computer-implemented method of claim 2 , further comprising:
upon determining that the update is included in the set of records obtained using the query, processing the update using the set of records.
4 . The computer-implemented method of claim 1 , further comprising:
determining a level of partitioning associated with the one or more filters based on a response time limit for querying of the data set;
using the level of partitioning to generate one or more additional queries associated with the one or more filters; and
using the one or more additional queries to obtain the set of records from the data set.
5 . The computer-implemented method of claim 1 , further comprising:
providing a user interface for obtaining the one or more filters; and
using the set of records to provide one or more visualizations associated with the data set within the user interface.
6 . The computer-implemented method of claim 6 , wherein the one or more visualizations are provided in a web browser.
7 . The computer-implemented method of claim 1 , wherein calculating the cardinality associated with the one or more filters comprises:
obtaining a number of distinct values for each dimension associated with the one or more filters; and
multiplying the number of distinct values with numbers of distinct values for other dimensions associated with the one or more filters.
8 . The computer-implemented method of claim 1 , wherein the query comprises one or more dimensions associated with the one or more filters and one or more metrics associated with the one or more dimensions.
9 . The computer-implemented method of claim 1 , wherein the one or more filters comprise at least one of a range, a value, and a flag.
10 . The computer-implemented method of claim 1 , wherein the level of aggregation is at least one of non-aggregated, semi-aggregated, and fully aggregated.
11 . The computer-implemented method of claim 1 , wherein the set of records comprises aggregated data that is associated with at least one of a sum, a count, a maximum, a minimum, and a summary statistic.
12 . An apparatus, comprising:
one or more processors; and
memory storing instructions that, when executed by the one or more processors, cause the apparatus to:
obtain one or more filters associated with dimensions of a data set;
calculate a cardinality associated with the one or more filters;
adjust a level of aggregation of a query associated with the one or more filters based on the cardinality and a query result limit for querying of the data set; and
use the query to obtain a set of records from the data set.
13 . The apparatus of claim 12 , wherein the memory further stores instructions that, when executed by the one or more processors, cause the apparatus to:
obtain an update to the one or more filters;
upon determining that the update is not included in the set of records obtained using the query, use a new query to obtain a new set of records associated with the update from the data set; and
upon determining that the update is included in the set of records obtained using the query, process the update using the set of records.
14 . The apparatus of claim 12 , wherein the memory further stores instructions that, when executed by the one or more processors, cause the apparatus to:
determine a level of partitioning associated with the one or more filters based on a response time limit for querying of the data set;
use the level of partitioning to generate one or more additional queries associated with the one or more filters; and
use the one or more additional queries to obtain the set of records from the data set.
15 . The apparatus of claim 12 , wherein the memory further stores instructions that, when executed by the one or more processors, cause the apparatus to:
provide a user interface for obtaining the one or more filters; and
use the set of records to provide one or more visualizations associated with the data set within the user interface.
16 . The apparatus of claim 12 , wherein calculating the cardinality associated with the one or more filters comprises:
obtaining a number of distinct values for each dimension associated with the one or more filters; and
multiplying the number of distinct values with numbers of distinct values for other dimensions associated with the one or more filters.
17 . The apparatus of claim 12 , wherein the query comprises one or more dimensions associated with the one or more filters and one or more metrics associated with the one or more dimensions.
18 . The apparatus of claim 12 , wherein the level of aggregation is at least one of non-aggregated, semi-aggregated, and fully aggregated.
19 . A system for processing data, comprising:
one or more processors;
a query-generation non-transitory computer readable medium comprising instructions that, when executed by the one or more processors, cause the system to configured to:
obtain one or more filters associated with dimensions of a data set;
calculate a cardinality associated with the one or more filters; and
adjust a level of aggregation of a query associated with the one or more filters based on the cardinality and a query result limit for querying of the data set; and
a communication non-transitory computer readable medium comprising instructions that, when executed by the one or more processors, cause the system to configured to use the query to obtain a set of records from the data set.
20 . The system of claim 19 , further comprising:
a presentation non-transitory computer readable medium comprising instructions that, when executed by the one or more processors, cause the system to configured to:
provide a user interface for obtaining the one or more filters; and
using the set of records to provide one or more visualizations associated with the data set within the user interface.