A probabilistic framework for estimating the accuracy of aggregate range queries evaluated over histograms