mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
PostgreSQL's estimate of the number of usermessage rows for a single message can be wildly off, due to poor statistics generation. This causes this query, with 100-message batch sizes, to incorrectly estimate millions of matched rows, causing it to perform a full-table index scan, rather than piecemeal using the `message_id` index. Reduce the batch size to 50, which is enough to tip in favor of a rational query plan.
51 KiB
51 KiB