added calculation of lock ratio in case it's not provided by db