Closed Bug 1496859 Opened 6 years ago Closed 6 years ago

Firefox Monitor: add index to subscribers.sha1 column in stage, then prod

Categories

(Cloud Services :: Operations: Deployment Requests - DEPRECATED, task)

task
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: groovecoder, Unassigned)

Details

We are receiving a spike of HIBP callback requests which look up our subscribers by sha1 hash. The RDS node is maxing on CPU. :(

Adding an index to the sha1 column should help this.

create index on subscribers (sha1);
Index created in stage, please verify.
(In reply to Bob Micheletto [:bobm] from comment #1)
> Index created in stage, please verify.

Verification done by :groovecoder via IRC:
groovecoder> bobm: stage DB good - works for subscribing, verifying, and notifying

Production index has been added.
Note: I've created a PR[1] to retro-actively add a migration for this DB change to our code-base for future environments. But since the index already exists in stage & prod, we should run this SQL to "fake" the migration that records this DB change:

INSERT INTO knex_migrations (name, batch, migration_time) values ('20181007085241_add_sha1_index.js', 4, '2018-10-07 08:52:42.000-05');

[1] https://github.com/mozilla/blurts-server/pull/520
Closing this bug.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.