mirror of
https://github.com/thelounge/thelounge.git
synced 2026-06-17 09:58:36 -04:00
Fixes #5103 Today, `getMessages()` filters by `(network, channel)` but sorts by `time DESC, id DESC` and no index covers both (and a new one supersedes `network_channel`). This has always been an issue but https://github.com/thelounge/thelounge/pull/5055 made this code synchronous which exposed it. | | Before | After | |--------|--------|--------| | history load, 5 channels (4.4M rows total, busiest 3M) | 6.9s, event loop blocked | 80ms | | single channel with 3M messages | 4.6s | 18ms | | query plan | index scan + temp B-tree sort | index only |