Add index in hostdailycounters table
Managed counters table as a function