Aggregation queries are performed by first identifying outlier values,
aggregating the outlier values, and sampling the remaining data after
pruning the outlier values. The sampled data is extrapolated and added to
the aggregated outlier values to provide an estimate for each aggregation
query. Outlier values are identified by selecting values outside of a
selected sliding window of data having the lowest variance. An index is
created for the outlier values. The outlier data is removed from the
window of data, and separately aggregated. The remaining data without the
outliers is then sampled to provide a statistically relevant sample that
is then aggregated and extrapolated to provide an estimate for the
remaining data. This sampled estimate is combined with the outlier
aggregate to form an estimate for the entire set of data.