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

16 lines
2.1 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' ORDER BY m.created_at ASC, m.id ASC LIMIT 50;" 2>&1 | Tee-Object "$EV5\02-explain-huge-first.txt"
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Limit (cost=0.42..10.87 rows=50 width=110) (actual time=0.040..0.176 rows=50 loops=1)
Buffers: shared hit=53
-> Index Scan using idx_messages_chat_created_asc_id on messages m (cost=0.42..10548.00 rows=50436 width=110) (actual time=0.039..0.172 rows=50 loops=1)
Index Cond: (chat_id = 'aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa'::uuid)
Buffers: shared hit=53
Planning:
Buffers: shared hit=143 dirtied=3
Planning Time: 0.953 ms
Execution Time: 0.229 ms
(9 rows)