mozilla-services / syncstorage-rs

Sync Storage server in Rust
Mozilla Public License 2.0
894 stars 49 forks source link

Unneeded `order by` #1528

Open cvalaas opened 6 months ago

cvalaas commented 6 months ago

https://github.com/mozilla-services/syncstorage-rs/blob/8faf7280de843b5d398aeb997c99aebfdc5d9a8c/tools/tokenserver/database.py#L96

This "order by" means the database has to sort ALL the matching records, then return the first 10 (default, and subject to an offset). If we don't need the ordering, then the database can respond much faster.

┆Issue is synchronized with this Jira Task

cvalaas commented 6 months ago

This is probably an unnoticeable slowdown normally, but given that we haven't cleared out records in a while, this could be big