Add timestamp index and fix some view maintenance