From 683083f4bb774d8f2de79bbb65cff557de3af4a1 Mon Sep 17 00:00:00 2001
From: Mohamed Bassem <me@mbassem.com>
Date: Thu, 11 Dec 2025 10:27:03 +0000
Subject: fix: add more indicies for faster bookmark queries (#2246)

---
 packages/db/drizzle/0068_optimize_bookmark_indicies.sql | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 packages/db/drizzle/0068_optimize_bookmark_indicies.sql

(limited to 'packages/db/drizzle/0068_optimize_bookmark_indicies.sql')

diff --git a/packages/db/drizzle/0068_optimize_bookmark_indicies.sql b/packages/db/drizzle/0068_optimize_bookmark_indicies.sql
new file mode 100644
index 00000000..dc0c7a64
--- /dev/null
+++ b/packages/db/drizzle/0068_optimize_bookmark_indicies.sql
@@ -0,0 +1,8 @@
+DROP INDEX `bookmarks_archived_idx`;--> statement-breakpoint
+DROP INDEX `bookmarks_favourited_idx`;--> statement-breakpoint
+CREATE INDEX `bookmarks_userId_createdAt_id_idx` ON `bookmarks` (`userId`,`createdAt`,`id`);--> statement-breakpoint
+CREATE INDEX `bookmarks_userId_archived_createdAt_id_idx` ON `bookmarks` (`userId`,`archived`,`createdAt`,`id`);--> statement-breakpoint
+CREATE INDEX `bookmarks_userId_favourited_createdAt_id_idx` ON `bookmarks` (`userId`,`favourited`,`createdAt`,`id`);--> statement-breakpoint
+CREATE INDEX `bookmarksInLists_listId_bookmarkId_idx` ON `bookmarksInLists` (`listId`,`bookmarkId`);--> statement-breakpoint
+CREATE INDEX `rssFeedImports_rssFeedId_bookmarkId_idx` ON `rssFeedImports` (`rssFeedId`,`bookmarkId`);--> statement-breakpoint
+CREATE INDEX `tagsOnBookmarks_tagId_bookmarkId_idx` ON `tagsOnBookmarks` (`tagId`,`bookmarkId`);
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

