Page MenuHomePhabricator

[server] Always filter message queries by message creation time
ClosedPublic

Authored by ashoat on Mar 6 2022, 3:44 PM.
Tags
None
Referenced Files
F3299385: D3349.diff
Sun, Nov 17, 11:31 AM
Unknown Object (File)
Wed, Nov 6, 11:36 AM
Unknown Object (File)
Sat, Nov 2, 8:32 AM
Unknown Object (File)
Sun, Oct 27, 12:58 AM
Unknown Object (File)
Sun, Oct 27, 12:58 AM
Unknown Object (File)
Sat, Oct 26, 8:12 PM
Unknown Object (File)
Sat, Oct 26, 8:11 PM
Unknown Object (File)
Sat, Oct 26, 8:11 PM

Details

Summary

This solves ENG-812: Improve perf of website load. By limiting the amount of messages that MySQL has to look at in order to resolve fetchMessageInfos, we speed up website load significantly.

On my local environment using the prod database, the query resolves in 0.5s instead of 20s.

Depends On D3348

Test Plan

I downloaded the prod database to my local machine and tested how long the query to load the website took. This change reduced it from 20s to 0.5s

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat requested review of this revision.Mar 6 2022, 3:55 PM

I realized I should probably gate this behind a hasMinCodeVersion given native needs D3350, D3352, and D3353 to work properly with this change. Just put up D3354 to gate the changes

benschac added inline comments.
lib/types/message-types.js
471 ↗(On Diff #10094)

q: Could you add a comment here with the normalized amount of time here? I'm assuming it's two weeks at a glance but wasn't 100%.

Also, might just be me but it feels odd that there's a time value in message-types

On my local environment using the prod database, the query resolves in 0.5s instead of 20s.

It's great to hear that!

This revision is now accepted and ready to land.Mar 8 2022, 6:46 AM