This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user