extracted ExtractIndexAndSql from Sql class
extracted ExtractIndexAndSql