Sql optimise new index merged branch

Sql optimise new index merged