SERVER-8008 Moved checks for sort pattern to early and performed them only once per update.