forked from mtusi2026/mtusi2026lab2
ЛР 2: исследовать и ограничить cache stampede — на 5
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
Rows in test chat: 10000
|
||||
|
||||
Position: 0
|
||||
Limit (cost=0.29..4.17 rows=51 width=70) (actual time=0.016..0.064 rows=51 loops=1)
|
||||
Buffers: shared hit=3
|
||||
-> Index Scan using messages_history on messages (cost=0.29..762.53 rows=10000 width=70) (actual time=0.015..0.030 rows=51 loops=1)
|
||||
Index Cond: (chat_id = '75f21d02-9989-494a-9028-54436d4d64c8'::uuid)
|
||||
Buffers: shared hit=3
|
||||
Planning:
|
||||
Buffers: shared hit=18
|
||||
Planning Time: 0.388 ms
|
||||
Execution Time: 0.157 ms
|
||||
|
||||
Position: 5000
|
||||
Limit (cost=0.29..5.44 rows=51 width=70) (actual time=0.015..0.036 rows=51 loops=1)
|
||||
Buffers: shared hit=4
|
||||
-> Index Scan using messages_history on messages (cost=0.29..503.80 rows=4981 width=70) (actual time=0.014..0.029 rows=51 loops=1)
|
||||
Index Cond: ((chat_id = '75f21d02-9989-494a-9028-54436d4d64c8'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.005001+00'::timestamp with time zone, '3bf71f4a-89cf-43ad-b422-ffe236dc1f2c'::uuid)))
|
||||
Buffers: shared hit=4
|
||||
Planning Time: 0.109 ms
|
||||
Execution Time: 0.135 ms
|
||||
|
||||
Position: 9900
|
||||
Limit (cost=0.29..68.56 rows=51 width=70) (actual time=0.028..0.046 rows=51 loops=1)
|
||||
Buffers: shared hit=3
|
||||
-> Index Scan using messages_history on messages (cost=0.29..135.50 rows=101 width=70) (actual time=0.027..0.038 rows=51 loops=1)
|
||||
Index Cond: ((chat_id = '75f21d02-9989-494a-9028-54436d4d64c8'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.009901+00'::timestamp with time zone, 'afbc2087-9faa-444d-b4f8-a2e8e1f28fe0'::uuid)))
|
||||
Buffers: shared hit=3
|
||||
Planning Time: 0.178 ms
|
||||
Execution Time: 0.085 ms
|
||||
PostgreSQL: 16.8 (Debian 16.8-1.pgdg120+1)
|
||||
Durability: on on
|
||||
PASS: actual EXPLAIN ANALYZE BUFFERS at first/middle/tail; API traversal 10000 rows, 100 pages, 2.597s
|
||||
Reference in New Issue
Block a user