From 485486c7ff986712ecb09e92217236d276d317c4 Mon Sep 17 00:00:00 2001
From: Claude <noreply@anthropic.com>
Date: Mon, 12 Jan 2026 08:46:55 +0000
Subject: feat: deduplicate feed items by guid

Use ROW_NUMBER() window function to filter out duplicate articles
with the same guid across different feeds. This ensures each guid
appears only once in unread/read article lists.

- Add idx_articles_guid index for PARTITION BY performance
- Modify GetUnreadArticles and GetReadArticles queries with CTE
---
 backend/db/migrations/005_add_guid_index.sql | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 backend/db/migrations/005_add_guid_index.sql

(limited to 'backend/db/migrations/005_add_guid_index.sql')

diff --git a/backend/db/migrations/005_add_guid_index.sql b/backend/db/migrations/005_add_guid_index.sql
new file mode 100644
index 0000000..a653d79
--- /dev/null
+++ b/backend/db/migrations/005_add_guid_index.sql
@@ -0,0 +1,2 @@
+-- Add index on guid for deduplication queries
+CREATE INDEX IF NOT EXISTS idx_articles_guid ON articles(guid);
-- 
cgit v1.2.3-70-g09d2

