mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
Every insert into `fts_update_log` triggers a `NOTIFY`; processing a batch of 1000 for every NOTIFY that we get thus results in a lot of extra processing of no rows. Instead, we clear all notifies, and repeat the pattern of processing rows until the batch comes up short. This may still result in extra wake-ups, in the event that a new NOTIFY occurs after we clear them, and that new row is processed by us in `update_all_rows`. However, these wake-ups are necessary for correctness, and this change will result in drastically fewer extra checks.