Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit 034b3b0

Browse files
committed
fix(accountRecord): Rollback accountRecord_4 due to unexplained performance issues.
1 parent a68bfa6 commit 034b3b0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/db/mysql.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,9 +896,20 @@ module.exports = function (log, error) {
896896
// Fields : uid, email, normalizedEmail, emailVerified, emailCode, kA, wrapWrapKb, verifierVersion, authSalt,
897897
// verifierSetAt, createdAt, lockedAt, primaryEmail, profileChangedAt
898898
// Where : emails.normalizedEmail = LOWER($1)
899-
var GET_ACCOUNT_RECORD = 'CALL accountRecord_4(?)'
899+
//
900+
// There's a newer version of this query named `accountRecord_4`
901+
// which pulls the `profileChangedAt` column from the database.
902+
// We're experiencing unexpectedly bad query performance for
903+
// reasons that we don't yet understand, so we've reverted to
904+
// using an older version of the query while we're figuring that out.
905+
// Ref: https://github.com/mozilla/fxa-content-server/issues/6655
906+
var GET_ACCOUNT_RECORD = 'CALL accountRecord_2(?)'
900907
MySql.prototype.accountRecord = function (email) {
901908
return this.readFirstResult(GET_ACCOUNT_RECORD, [email])
909+
.then(record => {
910+
record.profileChangedAt = record.verifierSetAt || record.createdAt
911+
return record
912+
})
902913
}
903914

904915
// Select : emails

0 commit comments

Comments
 (0)