HomePhabricator
Diffusion Comm ae8eb251cfc8

[keyserver] Improve fetchKnownUserInfos query performance

Description

[keyserver] Improve fetchKnownUserInfos query performance

Summary:
Most of the context is in ENG-3878:

I've identified a query that returns the same information, but has significantly better performance.

Following my earlier observation that the OR clause in the uploads join is responsible for the majority of the cost, I split that join up into two joins.

Test Plan:

  1. First, I compared how long the query took on my keyserver MariaDB in production. I found it sped the query up from ~3.1s to ~0.4s.
  2. Next, I tested this code change in my local environment. I tested loading the web app and creating a sidebar.
  3. Finally, I deployed this code change to my keyserver in production, and found that it improved the performance in some cases, and made it possible for me to create sidebars again (albeit after one retry).

Reviewers: tomek, atul

Reviewed By: tomek

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

Details

Provenance
ashoatAuthored on Jul 14 2023, 12:46 PM
Reviewer
tomek
Differential Revision
D8499: [keyserver] Improve fetchKnownUserInfos query performance
Parents
rCOMM3ecc07921927: [CI] Buildkite for web emscripten build
Branches
Unknown
Tags
Unknown