Files
open-webui/backend/open_webui/utils
Classic298 59bd4991e2 perf: faster notification badge and inbox on instances with many chats (#35070)
For regular users, every refresh of the notification badge and every inbox page compared their chat notifications against every chat they could see, and opened the saved copy of every shared chat on the instance to find the ones set to "Allow replies". That cost grew with the size of the instance, to about 70 ms per badge refresh on SQLite and 50 ms on Postgres at 50,000 chats. Now the user's own chats, the chats in their folders and the chats shared with them are looked up separately, and only the saved copies of chats shared with that user get opened. Who sees which notification is unchanged, comment notifications on chats included.

<table>
<tr><th>Regular user, median ms per request</th><th>SQLite before</th><th>SQLite after</th><th>Postgres before</th><th>Postgres after</th></tr>
<tr><td>Badge refresh, 5,000 chats</td><td>15.0</td><td>11.7</td><td>20.8</td><td>17.5</td></tr>
<tr><td>Inbox first page, 5,000 chats</td><td>19.0</td><td>15.1</td><td>27.8</td><td>23.9</td></tr>
<tr><td>Badge refresh, 50,000 chats</td><td>72.1</td><td>23.9</td><td>51.0</td><td>26.2</td></tr>
<tr><td>Inbox first page, 50,000 chats</td><td>78.3</td><td>26.9</td><td>57.3</td><td>31.9</td></tr>
<tr><td>Chat comment mentioning 5 people, 50,000 chats</td><td>312.5</td><td>43.6</td><td>159.3</td><td>88.2</td></tr>
</table>

Fixes #35066
2026-11-25 23:51:53 +04:00
..
2026-11-24 20:24:18 +04:00
2026-11-25 04:45:54 +04:00
2026-11-19 19:13:33 +04:00
2026-11-22 20:43:18 +04:00
2026-11-19 19:13:33 +04:00
2026-11-13 17:36:00 +09:00
2026-11-16 21:10:30 +09:00
2026-11-22 17:13:34 +04:00
2026-11-09 08:05:51 +09:00
2026-11-25 02:15:42 +04:00
2026-11-25 13:06:56 +04:00
2026-11-16 21:10:30 +09:00
2026-10-12 17:29:04 +04:00
2026-07-23 02:54:56 -04:00
2026-11-24 22:11:32 +04:00
2026-07-31 17:41:14 -04:00
2026-11-25 04:57:27 +04:00
2026-11-13 17:36:00 +09:00
2026-11-02 08:48:51 +09:00
2026-11-25 13:06:56 +04:00
2026-11-24 19:10:42 +04:00
2026-11-17 22:30:21 +09:00
2026-11-25 05:03:58 +04:00
2026-11-23 03:29:58 +04:00
2026-07-26 23:09:22 -04:00
2026-11-05 16:54:50 +09:00
2026-11-02 08:48:51 +09:00
2026-11-22 02:10:33 +04:00
2026-11-02 08:48:51 +09:00
2026-11-22 20:33:28 +04:00
2026-11-22 16:26:59 +04:00
2026-03-17 17:58:01 -05:00
2026-08-24 18:29:36 -04:00
2026-11-25 13:06:56 +04:00
2026-11-25 04:31:16 +04:00
2026-10-16 14:31:39 +04:00
2026-11-22 17:13:34 +04:00
2026-11-25 05:11:32 +04:00
2026-11-22 16:26:59 +04:00
2026-11-22 17:13:34 +04:00
2026-11-22 17:13:34 +04:00
2026-11-22 17:13:34 +04:00
2026-11-20 21:51:19 +04:00
2026-11-02 08:48:51 +09:00
2026-10-11 15:55:57 +04:00
2026-11-02 08:48:51 +09:00