16 lines
2.6 KiB
Plaintext
16 lines
2.6 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 = '$MEDIUM' AND (m.created_at, m.id) > ('2026-09-15 00:00:00+00', '00000000-0000-0000-0000-000000000000') ORDER BY m.created_at ASC, m.id ASC LIMIT 50;" 2>&1 | Tee-Object "$EV5\07-explain-medium-tuple.txt"
|
|
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=0.42..131.55 rows=50 width=110) (actual time=0.036..0.113 rows=50 loops=1)
|
|
Buffers: shared hit=53
|
|
-> Index Scan using idx_messages_chat_created_asc_id on messages m (cost=0.42..5665.16 rows=2160 width=110) (actual time=0.035..0.109 rows=50 loops=1)
|
|
Index Cond: ((chat_id = '237c29c6-9d07-4f3b-b9f0-69b3428f1168'::uuid) AND (ROW(created_at, id) > ROW('2026-09-15 00:00:00+00'::timestamp with time zone, '00000000-0000-0000-0000-000000000000'::uuid)))
|
|
Buffers: shared hit=53
|
|
Planning:
|
|
Buffers: shared hit=136
|
|
Planning Time: 0.791 ms
|
|
Execution Time: 0.180 ms
|
|
(9 rows)
|
|
|