replace stat index with a unique constraint
let histogram task deal gracefully with duplicate entries
make time range in histogram task configurable
schedule histogram task daily