Sort attributes to avoid rebuilds due to hash random ordering