[#65391716]dont use special characters from timeslot names on sql
[#65391716]prevent timeslot name duplication
[#65391716]use time slot id to identify distribution on sql
Merge 65391716-stats-sql-bug to master

[Completes #65391716]