lab4 - оценка 4

This commit is contained in:
2026-10-26 16:10:22 +03:00
parent ec540a1a72
commit e4704a76d0
49 changed files with 5390 additions and 27 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;