Tom Moor and Claude Opus 4.8
b2bf82d78b
Add composite (userId, createdAt) index for searches.list ( #12767 )
...
* Add composite (userId, createdAt) index for searches.list
The searches.list endpoint filters by userId/teamId and orders by
createdAt DESC, but search_queries only had single-column indexes. Since
a row is inserted on every search, the table grows large and the planner
must either fetch and sort a user's entire search history or scan the
createdAt index until enough matching rows are found — both proportional
to history size rather than page size.
Add a composite index on (userId, createdAt) so the query can seek
directly to the user's rows in createdAt order and stop after LIMIT rows.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_013wAHcneY9eV4fZtCBq8Ue3
* Drop redundant userId and unused createdAt indexes on search_queries
With the new (userId, createdAt) composite index in place, the
single-column userId index is fully redundant (covered as a leftmost
prefix) and the createdAt index is unused — no query orders or filters
by createdAt without also constraining userId. Dropping both removes
index-maintenance overhead on the high-write search_queries table. The
teamId index is kept for the team permanent deleter.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_013wAHcneY9eV4fZtCBq8Ue3
* Use CONCURRENTLY for search_queries index changes to avoid table locks
Switch the composite index creation and the redundant index drops to raw
CREATE/DROP INDEX CONCURRENTLY IF [NOT] EXISTS so the migration takes no
blocking lock on the high-traffic search_queries table. The migration
runner (Umzug) does not wrap migrations in a transaction, so CONCURRENTLY
is safe here.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_013wAHcneY9eV4fZtCBq8Ue3
---------
Co-authored-by: Claude <noreply@anthropic.com >
2026-06-21 08:01:56 -04:00
..
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2026-04-04 16:11:10 -04:00
2026-04-04 16:11:10 -04:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2026-04-04 16:11:10 -04:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-11-29 06:40:55 -08:00
2021-12-16 22:30:23 -08:00
2025-07-08 18:01:48 -04:00
2021-12-19 13:58:16 -08:00
2025-10-12 13:15:53 -04:00
2022-01-21 18:11:50 -08:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2022-02-06 22:29:24 -08:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-10-12 13:15:53 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2022-06-28 22:44:50 -07:00
2025-07-08 18:01:48 -04:00
2022-06-28 22:44:50 -07:00
2025-07-08 18:01:48 -04:00
2022-08-25 23:47:13 -07:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2022-08-26 12:21:46 +05:30
2025-07-08 18:01:48 -04:00
2022-09-07 16:51:30 +05:30
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2022-09-14 16:07:39 +05:30
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2022-11-12 08:41:59 -08:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2023-02-04 14:26:54 -05:00
2025-07-08 18:01:48 -04:00
2023-03-17 08:23:32 -07:00
2023-03-31 09:17:58 +05:30
2025-07-08 18:01:48 -04:00
2023-05-20 07:47:32 -07:00
2023-05-20 07:47:32 -07:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2023-09-03 06:11:14 -07:00
2023-09-03 06:11:14 -07:00
2023-09-20 15:12:03 -07:00
2026-04-04 16:11:10 -04:00
2026-04-04 16:11:10 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2024-01-30 17:48:22 -08:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2023-11-21 13:16:57 +05:30
2023-11-21 13:16:57 +05:30
2023-11-22 21:35:04 -05:00
2025-07-08 18:01:48 -04:00
2023-12-06 05:37:46 -08:00
2023-12-11 17:28:39 -08:00
2023-12-26 23:12:09 -05:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2024-03-23 07:09:28 -07:00
2025-07-08 18:01:48 -04:00
2024-02-04 11:14:18 -08:00
2024-02-16 13:25:17 -05:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2024-04-15 19:13:12 -07:00
2024-04-13 06:01:15 -07:00
2024-05-25 15:17:19 -07:00
2024-06-18 18:34:45 -07:00
2025-07-08 18:01:48 -04:00
2024-06-20 06:18:35 -07:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2024-10-06 05:37:11 -07:00
2025-07-08 18:01:48 -04:00
2024-10-06 05:37:11 -07:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2024-09-03 17:20:56 -07:00
2024-09-12 16:42:31 -07:00
2025-07-08 18:01:48 -04:00
2024-10-03 16:27:25 -07:00
2025-07-08 18:01:48 -04:00
2024-11-02 06:21:43 -07:00
2024-11-08 17:28:30 -08:00
2024-11-06 18:06:19 -08:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2024-12-31 03:36:05 -08:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-03-04 17:56:44 -08:00
2025-03-02 05:07:30 -08:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-05-04 16:12:09 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-04-22 09:59:39 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-07-15 23:07:14 -04:00
2025-07-08 18:01:48 -04:00
2025-07-08 18:01:48 -04:00
2025-08-10 15:24:01 -04:00
2025-07-08 18:01:48 -04:00
2025-08-14 22:49:07 -04:00
2026-01-10 21:19:33 -05:00
2025-08-10 14:02:01 -04:00
2025-08-11 18:54:43 -04:00
2025-08-30 01:52:05 -04:00
2025-09-01 05:10:32 -04:00
2025-08-30 02:26:47 -04:00
2025-09-07 20:15:49 -04:00
2025-09-13 20:28:29 -04:00
2025-09-17 08:57:16 -04:00
2025-10-02 06:53:56 -04:00
2025-10-19 15:40:10 -04:00
2025-12-01 02:31:50 +01:00
2025-10-23 08:24:22 -04:00
2025-10-31 11:36:26 -04:00
2025-11-08 11:47:51 -05:00
2025-11-25 13:11:05 +01:00
2025-11-26 01:39:16 +01:00
2025-12-03 18:09:43 -05:00
2025-12-12 19:02:20 -05:00
2025-12-12 19:02:20 -05:00
2025-12-12 20:04:41 -05:00
2025-12-17 17:26:38 -05:00
2025-12-17 17:26:29 -05:00
2025-12-19 17:52:23 -05:00
2026-01-05 19:58:46 -05:00
2026-01-05 19:58:46 -05:00
2026-05-09 08:42:47 -04:00
2026-05-09 08:42:47 -04:00
2026-02-16 17:30:19 -05:00
2026-02-21 17:52:27 -05:00
2026-03-14 23:02:20 -04:00
2026-03-14 23:02:20 -04:00
2026-02-23 21:31:52 -05:00
2026-03-14 20:17:03 -04:00
2026-03-20 23:57:38 -04:00
2026-03-22 10:45:09 -04:00
2026-04-01 21:56:50 -04:00
2026-04-01 21:56:50 -04:00
2026-04-02 08:08:05 -04:00
2026-04-26 21:23:13 -04:00
2026-04-18 08:11:15 -04:00
2026-05-17 09:48:30 -04:00
2026-05-16 08:42:48 -04:00
2026-05-16 14:10:15 -04:00
2026-05-16 14:10:15 -04:00
2026-05-26 19:56:46 -04:00
2026-06-20 11:26:05 -04:00
2026-06-04 23:30:55 -04:00
2026-06-11 22:16:08 -04:00
2026-06-19 16:39:50 -04:00
2026-06-21 08:01:56 -04:00