open-webui/backend/open_webui/migrations/versions
Classic298 16c2a9eda4
Some checks are pending
Python CI / Ruff Format (3.11) (push) Waiting to run
Python CI / Ruff Format (3.12) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args: free_disk:false name:main suffix:]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_CUDA=true USE_CUDA_VER=cu126 free_disk:true name:cuda126 suffix:-cuda126]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_CUDA=true free_disk:true name:cuda suffix:-cuda]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_OLLAMA=true free_disk:false name:ollama suffix:-ollama]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_SLIM=true free_disk:false name:slim suffix:-slim]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args: free_disk:false name:main suffix:]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_CUDA=true USE_CUDA_VER=cu126 free_disk:true name:cuda126 suffix:-cuda126]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_CUDA=true free_disk:true name:cuda suffix:-cuda]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_OLLAMA=true free_disk:false name:ollama suffix:-ollama]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_SLIM=true free_disk:false name:slim suffix:-slim]) (push) Waiting to run
Create and publish Docker images with specific build args / copy-to-dockerhub (-ollama, ollama) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-slim, slim) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:cuda suffix:-cuda]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:cuda126 suffix:-cuda126]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:main suffix:]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:ollama suffix:-ollama]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:slim suffix:-slim]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / notify-helm-charts (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (, main) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-cuda, cuda) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-cuda126, cuda126) (push) Blocked by required conditions
Frontend Build / Format & Build (push) Waiting to run
Frontend Build / Unit Tests (push) Waiting to run
fix: index the chat queries that make large SQLite instances unusable (#27663)
The timer scheduler polls once a second and cancels on every message send and chat open, the sidebar lists chats ordered by `updated_at`, and the folder badges count unread chats per folder. None of those could be served by an index, so each call read most of the `chat` table, and because `meta` sits after the chat payload column SQLite had to walk every row's overflow pages to get there. On a large history that stalls the sidebar, every chat switch and every send, and the idle poll alone burns about a quarter of a CPU core.

Timers now keep their due time in a dedicated `chat.timer_at` column behind a partial index, and the chat list, unread and unfinished-reply queries each get an index matching their filter and ordering. Existing pending timers are backfilled from their meta by the migration. Dropping the `internal` and `type` checks also makes a forked timer chat inert, where a fork used to copy `meta` verbatim and become a second claim target that could fire a duplicate timer.

Measured on SQLite, same rows returned:

| query | before | after |
|---|---|---|
| idle timer poll (2000 chats, 0.43 GB) | 170 ms | 0.04 ms |
| cancel on send and chat open (4000 chats, 377 MB) | 200 ms | 0.04 ms |
| sidebar chat list (15000 chats, 1.26 GB) | 157 ms | 1.8 ms |
| folder unread badges (15000 chats, 1.4 GB) | 54 ms | 0.2 ms |

PostgreSQL 17 serves all of them as index-only scans with no sort node. Exercised through fresh install, upgrade with seeded data, downgrade and re-upgrade on SQLite and PostgreSQL 17.

Fixes #27622
2026-08-23 16:11:54 -05:00
..
1af9b942657b_migrate_tags.py refac 2026-05-14 13:46:08 +09:00
1ce6ade7d93b_add_group_member_user_id_index.py perf: index group_member on (user_id, group_id) (#27822) 2026-07-31 19:09:15 -05:00
2f1211949ecc_update_message_and_channel_member_table.py refac 2026-05-14 13:49:15 +09:00
3ab32c4b8f59_update_tags.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
3af16a1c9fb6_update_user_table.py refac 2026-05-14 13:46:36 +09:00
3c9b0ca343fd_add_knowledge_directory_table.py chore: format 2026-06-01 13:56:55 -07:00
3e0e00844bb0_add_knowledge_file_table.py refac 2026-05-14 13:46:36 +09:00
3ff2c63645b8_reshape_config_to_per_key_rows.py refac 2026-06-29 13:03:14 -05:00
4ace53fd72c8_update_folder_table_datetime.py refac 2026-05-14 14:12:42 +09:00
4c5ce3d2f27f_add_context_summary_to_chat_message.py refac 2026-06-19 00:16:06 +02:00
4de81c2a3af1_add_pinned_note_table.py chore: format 2026-06-01 13:56:55 -07:00
6a39f3d8e55c_add_knowledge_table.py refac 2026-05-14 14:05:28 +09:00
6d09d1bf1f23_repair_double_encoded_user_oauth.py refac 2026-08-10 23:22:08 -06:00
7b3f2a9c1d4e_add_memory_type.py refac 2026-06-29 00:21:37 -05:00
7e5b5dc7342b_init.py chore: format 2026-06-01 13:56:55 -07:00
9a1b2c3d4e5f_add_current_message_id_to_chat.py chore: format 2026-07-23 13:41:16 -04:00
9f0c9cd09105_add_note_table.py refac 2026-05-14 13:45:39 +09:00
37f288994c47_add_group_member_table.py refac 2026-05-14 13:46:23 +09:00
38d63c18f30f_add_oauth_session_table.py chore: format 2026-06-01 13:56:55 -07:00
42e2978c7933_add_memory_path_and_meta.py refac 2026-06-29 05:49:49 -05:00
55f1302ac17c_add_memory_id_user_id_covering_index.py refac 2026-07-24 01:54:36 -04:00
57c599a3cb57_add_channel_table.py refac 2026-05-14 13:49:50 +09:00
81cc2ce44d79_update_channel_file_and_knowledge_table.py refac 2026-05-14 13:45:59 +09:00
90ef40d4714e_update_channel_and_channel_members_table.py refac 2026-05-14 13:45:59 +09:00
242a2047eae0_update_chat_table.py refac 2026-06-29 11:59:50 -05:00
374d2f66af06_add_prompt_history_table.py refac 2026-05-14 14:06:32 +09:00
856c5b02fb54_add_chat_message_meta.py refac 2026-07-16 01:42:24 -04:00
922e7a387820_add_group_table.py refac 2026-05-14 13:45:39 +09:00
959eaac8f909_add_automation_folder_id.py chore: format 2026-07-27 00:12:47 -04:00
3781e22d8b01_update_message_table.py chore: format 2026-06-01 13:56:55 -07:00
6283dc0e4d8d_add_channel_file_table.py chore: format 2026-06-01 13:56:55 -07:00
7826ab40b532_update_file_table.py refac 2026-05-14 13:46:54 +09:00
8452d01d26d7_add_chat_message_table.py refac 2026-05-14 13:46:54 +09:00
461111b60977_add_missing_primary_keys_to_legacy_.py chore: format 2026-06-01 13:56:55 -07:00
018012973d35_add_indexes.py refac 2026-05-14 14:06:32 +09:00
56359461a091_add_calendar_tables.py chore: format 2026-06-01 13:56:55 -07:00
a0b1c2d3e4f5_add_memory_user_id_index.py refac 2026-05-14 13:45:31 +09:00
a1b2c3d4e5f6_add_skill_table.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
a3dd5bedd151_add_tasks_and_summary_to_chat.py refac 2026-05-14 03:06:37 +09:00
a5c220713937_add_reply_to_id_column_to_message.py refac 2026-05-14 13:45:31 +09:00
af906e964978_add_feedback_table.py refac 2026-05-14 13:45:21 +09:00
b2c3d4e5f6a7_add_scim_column_to_user_table.py refac 2026-05-14 13:45:21 +09:00
b7c8d9e0f1a2_add_last_read_at_to_chat.py refac 2026-05-14 03:06:37 +09:00
b10670c03dd5_update_user_table.py refac 2026-08-10 23:22:08 -06:00
b0018471bbbe_add_user_variables.py chore: format 2026-07-27 00:12:47 -04:00
c0fbf31ca0db_update_file_table.py refac 2026-05-14 13:45:12 +09:00
c1d2e3f4a5b6_add_shared_chat_table.py chore: format 2026-06-01 13:56:55 -07:00
c29facfe716b_update_file_table_path.py refac 2026-05-14 13:45:12 +09:00
c69f45358db4_add_folder_table.py refac 2026-05-14 13:45:05 +09:00
c49178636c78_add_chat_variables.py chore: format 2026-07-27 00:12:47 -04:00
c440947495f3_add_chat_file_table.py refac 2026-05-14 13:45:05 +09:00
ca81bd47c050_add_config_table.py refac 2026-05-14 13:44:50 +09:00
d4c1a8e37b62_add_chat_timer_at_and_chat_indexes.py fix: index the chat queries that make large SQLite instances unusable (#27663) 2026-08-23 16:11:54 -05:00
d4e5f6a7b8c9_add_automation_tables.py refac 2026-05-14 14:12:42 +09:00
d31026856c01_update_folder_table_data.py refac 2026-05-14 13:44:50 +09:00
e1f2a3b4c5d6_add_is_pinned_to_note.py refac 2026-05-14 03:06:37 +09:00
f0bd01a18a3d_add_unique_normalized_user_email_index.py chore: format 2026-07-27 04:46:45 -04:00
f1e2d3c4b5a6_add_access_grant_table.py refac 2026-05-14 14:05:28 +09:00