add optimize option in dump script