how about modifying it to log how long each query takes to run, then tackling the longest running query first, etc