As of v5.2.4 / v6.0.0-RC1, the method `MongoStepExecutionDao#countStepExecutions` is not optimized, it uses nested loops to count step executions. This method should be optimized to perform a count query using a `MongoOperations#count` operation.