SQL speedies

Added index to table so when requesting the hit count. Query resolves loads faster.

Added index to upgrade action.