Page MenuHomePhabricator

[keyserver] Fix account deletion performance
ClosedPublic

Authored by ashoat on Mar 24 2023, 5:04 PM.
Tags
None
Referenced Files
F3392039: D7174.id24106.diff
Sat, Nov 30, 6:53 AM
Unknown Object (File)
Wed, Nov 27, 6:34 AM
Unknown Object (File)
Wed, Nov 27, 6:21 AM
Unknown Object (File)
Wed, Nov 27, 3:53 AM
Unknown Object (File)
Mon, Nov 11, 2:36 AM
Unknown Object (File)
Wed, Nov 6, 3:40 PM
Unknown Object (File)
Wed, Nov 6, 3:39 PM
Unknown Object (File)
Wed, Nov 6, 3:39 PM
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
Branch
ashoat/delete
Lint
No Lint Coverage
Unit
No Test Coverage

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.