Sped up access of statistics data.

Added a column index to Bucket.bucket_id, which links the bucket
table to the histogram table.
Docs: Fixed histogram buckets equation.