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)
Fri, Mar 14, 11:10 PM
Unknown Object (File)
Fri, Mar 7, 1:42 AM
Unknown Object (File)
Mon, Mar 3, 5:06 PM
Unknown Object (File)
Feb 16 2025, 2:15 AM
Unknown Object (File)
Feb 16 2025, 2:15 AM
Unknown Object (File)
Feb 16 2025, 2:15 AM
Unknown Object (File)
Feb 16 2025, 2:11 AM
Unknown Object (File)
Feb 14 2025, 9:43 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