CPC G06F 16/2477 (2019.01) [G06F 16/2228 (2019.01); G06F 16/24556 (2019.01)] | 17 Claims |
1. A computer-implemented method, comprising operations for:
receiving time series records from a native Time Series Database (TSDB), wherein each of the time series records includes a timestamp and one or more tags, wherein the native TSDB comprises first shards associated with first timeslots;
determining second timeslots for second shards for a sparse TSDB based on the timestamp included in each of the time series records;
building the sparse TSDB by creating the second shards for the determined second timeslots and storing the time series records in the second shards, while filling in empty ranges in the second shards;
receiving a query that specifies at least one of the one or more tags that identify particular time series records;
determining whetherto execute the query against one of the sparse TSDB and the native TSDB;
in response to determining that the query is to be executed against the sparse TSDB based on determining that the particular time series records are queried more frequently than other time series records identified by other queries based on historical queries and determining that a density of the time series records in the native TSDB is larger than a sparse threshold, executing the query against the sparse TSDB to generate first results;
in response to determining that the query is to be executed against the native TSDB based on one of determining that the particular time series records are queried less frequently than the other time series records identified by the other queries based on the historical queries and determining that the density of the time series records in the native TSDB is less than or equal to the sparse threshold, executing the query against the native TSDB to generate second results; and
returning one of the first results and the second results.
|