SONAR-926 improve perf of the db migration 497