Efficient histogram-based range query estimation for dirty data