Histogram to DB