Optimization about findExecutionsCountByTid sql query.