lab2 - оценка 5
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-10-07 19:06:42 +03:00
parent 65003b6119
commit f07ad1e097
32 changed files with 3718 additions and 18 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;