SQL case indexes

#3329
@czue @dannyroberts not sure if checking the actions is necessary. Is it safe to assume that if none of the main fields have changed then there are no changes to the actions?