updating sql with indexs