This commit is contained in:
Evgeny Bushkov
2026-11-06 13:32:02 +03:00
parent 302b10cc38
commit e5dde9ea29
18 changed files with 1464 additions and 3 deletions
+8
View File
@@ -0,0 +1,8 @@
-- Ожидаем Index Scan по messages_chat_created_idx, без Seq Scan всей истории.
EXPLAIN (ANALYZE, BUFFERS)
SELECT id, chat_id, sender_id, text, created_at
FROM messages
WHERE chat_id = '00000000-0000-4000-8000-000000000000'
AND (created_at, id) > ('2026-01-01T00:00:00Z', '00000000-0000-4000-8000-000000000000')
ORDER BY created_at, id
LIMIT 51;