Page MenuHomePhabricator

[keyserver] Fix account deletion performance
ClosedPublic

Authored by ashoat on Mar 24 2023, 5:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 23, 7:35 AM
Unknown Object (File)
Fri, Dec 6, 9:52 PM
Unknown Object (File)
Fri, Dec 6, 9:52 PM
Unknown Object (File)
Fri, Dec 6, 9:52 PM
Unknown Object (File)
Thu, Dec 5, 7:59 AM
Unknown Object (File)
Thu, Dec 5, 7:58 AM
Unknown Object (File)
Thu, Dec 5, 7:58 AM
Unknown Object (File)
Thu, Dec 5, 2:00 AM
Subscribers
None

Details

Summary

Account deletion used to time out. After this it's basically instantaneous. The reports table is pretty huge...

More context here on Linear.

Test Plan

I ran it on prod and it fixed the issue

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I analyzed the queries we run on the reports table and found that creating a report runs this query, so I refined this index so it can help there as well. No other queries on reports seemed to do a full scan

Forgot to update createTables in the last revision

ashoat added inline comments.
keyserver/src/cron/cron.js
30 ↗(On Diff #24106)

Not sure why I missed this one in D6334. The context is explained there

keyserver/src/database/migration-config.js
224 ↗(On Diff #24106)

I already created this index on prod to test the fix, before I realized it would be better to have a more specific index. This part of the query should only affect prod

tomek added inline comments.
keyserver/src/cron/cron.js
30 ↗(On Diff #24106)

This is specific to a location of a keyserver, so we can also consider saying that it's in a keyserver's timezone instead of specifying a timezone explicitly.

This revision is now accepted and ready to land.Mar 27 2023, 2:10 AM

Clarify that it's in the timezone of the keyserver

This revision was landed with ongoing or failed builds.Mar 27 2023, 7:06 AM
This revision was automatically updated to reflect the committed changes.