remove unnecessary sql