message: Add index to the 'username' field. Fixes
diff: @@ -103,6 +103,22 @@ DataStore.prototype.setServerFromConfig = Promise.coroutine(function*(server, se
  yield this.storeRoom(ircRoom, mxRoom, 'config');
  }
  }
  +
  + // Some kinds of users may have the same user_id prefix so will cause ident code to hit
  + // getMatrixUserByUsername hundreds of times which can be slow:
  + // https://github.com/matrix-org/matrix-appservice-irc/issues/404
  + let domainKey = server.domain.replace(/\./g, "_");
  + this._userStore.db.ensureIndex({
  + fieldName: "data.client_config." + domainKey + ".username",
  + unique: true,
  + sparse: true
  + }, function(err) {
  + if (err) {
  + log.error("Failed to ensure ident username index on users database!");
  + return;
  + }
  + log.info("Indexes checked for ident username for " + server.domain + " on users database");
  + });
  });
  /**
  