Optimize update of big databases

Our datamodel contains more than 4000 tables and those optimizations allowed us to decrease the update time from 2h30 to 30 minutes ...