Files
mtusi2026lab2/evidence/lab2/track2-2026-10-08_c744ee5/03-explain-huge-or.txt
T
2026-10-08 22:19:50 +03:00

18 lines
3.0 KiB
Plaintext

docker compose --env-file .env exec db psql -U messenger -d messenger -c "EXPLAIN (ANALYZE, BUFFERS) SELECT m.id, m.chat_id, m.sender_id, m.text, m.created_at FROM messages m WHERE m.chat_id = '$HUGE' AND (m.created_at > '2026-09-15 00:00:00+00' OR (m.created_at = '2026-09-15 00:00:00+00' AND m.id > '00000000-0000-0000-0000-000000000000')) ORDER BY m.created_at ASC, m.id ASC LIMIT 50;" 2>&1 | Tee-Object "$EV5\03-explain-huge-or.txt"
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.42..25.19 rows=50 width=110) (actual time=15.831..15.864 rows=50 loops=1)
Buffers: shared hit=30514
-> Index Scan using idx_messages_chat_created_asc_id on messages m (cost=0.42..10926.27 rows=22054 width=110) (actual time=15.827..15.857 rows=50 loops=1)
Index Cond: (chat_id = 'aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa'::uuid)
Filter: ((created_at > '2026-09-15 00:00:00+00'::timestamp with time zone) OR ((created_at = '2026-09-15 00:00:00+00'::timestamp with time zone) AND (id > '00000000-0000-0000-0000-000000000000'::uuid)))
Rows Removed by Filter: 30208
Buffers: shared hit=30514
Planning:
Buffers: shared hit=147
Planning Time: 1.196 ms
Execution Time: 15.945 ms
(11 rows)