script to optimize db.