Optimize sequence for constraint alterations
When you alter several constraints, drops come before adds.
Where the changes are simple, it should be safe to group them in order to minimize the time that the constraint is not in effect. I have some huge tables. If I alter three constraints to switch from UPDATE to RESTRICT, for example, the third constraint is inactive until the table is literally copied three times.
There's another post about grouping the alter commands together, and this would make a big improvement where each change causes a table copy.
In the case I just ran into, however, the generated script was the least efficient method possible to make the necessary changes.