HomePhabricator
Diffusion Comm 6cd531cc066a

[keyserver] Revert D4675 window function for getMessageInfos

Description

[keyserver] Revert D4675 window function for getMessageInfos

Summary:
See context on Linear. The new query behaves differently from the old query for messages that have multiple associated uploads. We want to return 20 distinct messages, not 20 rows.

There might be a way to keep the window function construction, but I don't have time right now to investigate. The old query is definitely messier than the new one, but the performance is approximately the same after D4674 and D4673.

Test Plan: I ran the old query on MariaDB in production and confirmed it works, returns the right number of rows, and has approximately the same performance as the new query

Reviewers: tomek, atul

Reviewed By: atul

Subscribers: adrian, abosh

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