Faster query and better logging for deduplicate_users command.