Лаба6 - оценка 4

This commit is contained in:
2026-11-20 13:10:55 +03:00
parent 470d9d6f1e
commit a3c48d41e9
58 changed files with 8083 additions and 30 deletions
+10
View File
@@ -0,0 +1,10 @@
-- План запроса keyset-пагинации истории: первая страница (курсор = начало времён).
-- Ожидаем WITH index: Limit -> Index Scan using messages_history_idx
-- Ожидаем WITHOUT index: Limit -> Sort -> Seq Scan on messages
EXPLAIN (ANALYZE, BUFFERS)
SELECT id, chat_id, sender_id, text, created_at
FROM messages
WHERE chat_id = :'chat'
AND (created_at, id) > ('2020-01-01T00:00:00+00', '00000000-0000-0000-0000-000000000000')
ORDER BY created_at, id
LIMIT 51;