forked from mtusi2026/mtusi2026lab2
reworked
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
seeded_messages 10000 chat_id 364e2ede-c155-44e4-9a70-4f1a7cfcac5c
|
||||
|
||||
=== WITH index messages_chat_created_id_idx ===
|
||||
Limit (cost=0.28..8.30 rows=1 width=86) (actual time=0.012..0.017 rows=50 loops=1)
|
||||
Buffers: shared hit=3
|
||||
-> Index Scan using messages_chat_created_id_idx on messages (cost=0.28..8.30 rows=1 width=86) (actual time=0.011..0.014 rows=50 loops=1)
|
||||
Index Cond: ((chat_id = '364e2ede-c155-44e4-9a70-4f1a7cfcac5c'::uuid) AND (ROW(created_at, id) > ROW('2026-11-07 08:47:19.224775+00'::timestamp with time zone, 'b63c0a90-e11b-4742-b7a3-122f5ec164ca'::uuid)))
|
||||
Buffers: shared hit=3
|
||||
Planning:
|
||||
Buffers: shared hit=36
|
||||
Planning Time: 0.307 ms
|
||||
Execution Time: 0.061 ms
|
||||
|
||||
=== WITHOUT index scans (seq scan baseline) ===
|
||||
Limit (cost=206.18..206.19 rows=1 width=86) (actual time=2.041..2.046 rows=50 loops=1)
|
||||
Buffers: shared hit=130 read=11
|
||||
-> Sort (cost=206.18..206.19 rows=1 width=86) (actual time=2.040..2.042 rows=50 loops=1)
|
||||
Sort Key: created_at, id
|
||||
Sort Method: top-N heapsort Memory: 38kB
|
||||
Buffers: shared hit=130 read=11
|
||||
-> Seq Scan on messages (cost=0.00..206.17 rows=1 width=86) (actual time=0.080..0.805 rows=9999 loops=1)
|
||||
Filter: ((chat_id = '364e2ede-c155-44e4-9a70-4f1a7cfcac5c'::uuid) AND (ROW(created_at, id) > ROW('2026-11-07 08:47:19.224775+00'::timestamp with time zone, 'b63c0a90-e11b-4742-b7a3-122f5ec164ca'::uuid)))
|
||||
Rows Removed by Filter: 350
|
||||
Buffers: shared hit=124 read=11
|
||||
Planning Time: 0.053 ms
|
||||
Execution Time: 2.081 ms
|
||||
Reference in New Issue
Block a user