Feature #10054 New DBAPI function - $modx->db->optimize()
http://tracker.modx.com/issues/10054