Page MenuHomePhabricator

[keyserver] Improve SQL performance in deleteThread
ClosedPublic

Authored by ashoat on Aug 16 2023, 11:15 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 25, 4:33 PM
Unknown Object (File)
Tue, Nov 19, 10:29 AM
Unknown Object (File)
Mon, Nov 18, 10:49 PM
Unknown Object (File)
Tue, Nov 12, 10:36 AM
Unknown Object (File)
Tue, Nov 12, 9:50 AM
Unknown Object (File)
Tue, Nov 12, 9:06 AM
Unknown Object (File)
Tue, Nov 12, 4:00 AM
Unknown Object (File)
Oct 17 2024, 12:19 PM
Subscribers
None

Details

Summary

Noticed that deleteThread performance was horrendous... the query took like 15min, and it took locks on a bunch of tables while it was ongoing.

We had a similar problem for deleteAccount that was solved in D1288 by splitting up the query, so I decided to do the same thing here.

Test Plan
  1. Performance: I tested the query on my production keyserver and found that it took less than 0.1s.
  2. Correctness: I created a channel in my local dev environment, and then deleted it from the UI. I looked into the database and confirmed that the relevant rows were deleted.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage