add rewriteBatchedStatements memo