Fix slow upgrade for DB v19.