HomePhabricator
Diffusion Comm fb4078c01612

[keyserver] Improve SQL performance in deleteInaccessibleThreads

Description

[keyserver] Improve SQL performance in deleteInaccessibleThreads

Summary:
This has a similar problem to the parent diff. I refactored it to use two queries, the second of which is the same as in the parent diff.

Depends on D8837

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 an "inaccessible thread" in my local dev environment by manually running an INSERT INTO threads query. I then triggered the cronjob manually by changing the time it runs, and confirmed my new thread was deleted. I also ran it when no threads needed to be deleted, and confirmed nothing happened via console.loging the code in the function.

Reviewers: tomek, atul

Reviewed By: atul

Differential Revision: https://phab.comm.dev/D8838

Details

Provenance
ashoatAuthored on Aug 16 2023, 11:13 AM
Reviewer
atul
Differential Revision
D8838: [keyserver] Improve SQL performance in deleteInaccessibleThreads
Parents
rCOMMa00f7ca2cc31: [keyserver] Improve SQL performance in deleteThread
Branches
Unknown
Tags
Unknown