forked from mtusi2026/mtusi2026lab2
308 lines
18 KiB
Plaintext
308 lines
18 KiB
Plaintext
===== V0_pk_only / keyset_big_chat_middle (медиана 10.195 мс из 9) =====
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=5036.29..5036.42 rows=51 width=171) (actual time=10.450..10.456 rows=51 loops=1)
|
|
Buffers: shared hit=2632
|
|
-> Sort (cost=5036.29..5079.22 rows=17169 width=171) (actual time=10.448..10.451 rows=51 loops=1)
|
|
Sort Key: created_at, id
|
|
Sort Method: top-N heapsort Memory: 40kB
|
|
Buffers: shared hit=2632
|
|
-> Seq Scan on messages (cost=0.00..4463.50 rows=17169 width=171) (actual time=0.080..8.640 rows=29999 loops=1)
|
|
Filter: ((chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid) AND (ROW(created_at, id) > ROW('2026-10-02 06:45:15.998444+00'::timestamp with time zone, '7df96ec6-9cae-4a9d-9696-c854f9218ab5'::uuid)))
|
|
Rows Removed by Filter: 75001
|
|
Buffers: shared hit=2626
|
|
Planning:
|
|
Buffers: shared hit=113
|
|
Planning Time: 0.456 ms
|
|
Execution Time: 10.519 ms
|
|
(14 rows)
|
|
|
|
===== V0_pk_only / first_page_big_chat (медиана 9.149 мс из 9) =====
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=5585.66..5591.53 rows=51 width=171) (actual time=7.011..8.604 rows=51 loops=1)
|
|
Buffers: shared hit=2670
|
|
-> Gather Merge (cost=5585.66..9679.32 rows=35597 width=171) (actual time=7.009..8.600 rows=51 loops=1)
|
|
Workers Planned: 1
|
|
Workers Launched: 1
|
|
Buffers: shared hit=2670
|
|
-> Sort (cost=4585.65..4674.64 rows=35597 width=171) (actual time=5.790..5.792 rows=51 loops=2)
|
|
Sort Key: created_at, id
|
|
Sort Method: top-N heapsort Memory: 40kB
|
|
Buffers: shared hit=2670
|
|
Worker 0: Sort Method: top-N heapsort Memory: 39kB
|
|
-> Parallel Seq Scan on messages (cost=0.00..3398.06 rows=35597 width=171) (actual time=0.007..3.950 rows=30000 loops=2)
|
|
Filter: (chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid)
|
|
Rows Removed by Filter: 22500
|
|
Buffers: shared hit=2626
|
|
Planning:
|
|
Buffers: shared hit=114
|
|
Planning Time: 0.435 ms
|
|
Execution Time: 8.655 ms
|
|
(19 rows)
|
|
|
|
===== V0_pk_only / offset_big_chat_30000 (медиана 23.898 мс из 9) =====
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=13584.11..13589.97 rows=51 width=171) (actual time=20.720..23.072 rows=51 loops=1)
|
|
Buffers: shared hit=2670, temp read=1088 written=1370
|
|
-> Gather Merge (cost=10134.11..14227.76 rows=35597 width=171) (actual time=15.085..22.454 rows=30051 loops=1)
|
|
Workers Planned: 1
|
|
Workers Launched: 1
|
|
Buffers: shared hit=2670, temp read=1088 written=1370
|
|
-> Sort (cost=9134.10..9223.09 rows=35597 width=171) (actual time=13.549..14.977 rows=15192 loops=2)
|
|
Sort Key: created_at, id
|
|
Sort Method: external merge Disk: 5800kB
|
|
Buffers: shared hit=2670, temp read=1088 written=1370
|
|
Worker 0: Sort Method: external merge Disk: 5128kB
|
|
-> Parallel Seq Scan on messages (cost=0.00..3398.06 rows=35597 width=171) (actual time=0.006..4.295 rows=30000 loops=2)
|
|
Filter: (chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid)
|
|
Rows Removed by Filter: 22500
|
|
Buffers: shared hit=2626
|
|
Planning:
|
|
Buffers: shared hit=114
|
|
Planning Time: 0.422 ms
|
|
Execution Time: 23.755 ms
|
|
(19 rows)
|
|
|
|
===== V0_pk_only / first_page_small_chat (медиана 5.785 мс из 9) =====
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=3938.69..3938.72 rows=11 width=171) (actual time=5.746..5.749 rows=10 loops=1)
|
|
Buffers: shared hit=2632
|
|
-> Sort (cost=3938.69..3938.72 rows=11 width=171) (actual time=5.745..5.746 rows=10 loops=1)
|
|
Sort Key: created_at, id
|
|
Sort Method: quicksort Memory: 27kB
|
|
Buffers: shared hit=2632
|
|
-> Seq Scan on messages (cost=0.00..3938.50 rows=11 width=171) (actual time=5.401..5.713 rows=10 loops=1)
|
|
Filter: (chat_id = 'b8b701bf-339f-44c0-9468-9e10800583fe'::uuid)
|
|
Rows Removed by Filter: 104990
|
|
Buffers: shared hit=2626
|
|
Planning:
|
|
Buffers: shared hit=114
|
|
Planning Time: 0.440 ms
|
|
Execution Time: 5.777 ms
|
|
(14 rows)
|
|
|
|
===== V1_chat_id / keyset_big_chat_middle (медиана 8.189 мс из 9) =====
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=4916.20..4916.32 rows=51 width=171) (actual time=8.528..8.535 rows=51 loops=1)
|
|
Buffers: shared hit=1567
|
|
-> Sort (cost=4916.20..4958.68 rows=16994 width=171) (actual time=8.526..8.530 rows=51 loops=1)
|
|
Sort Key: created_at, id
|
|
Sort Method: top-N heapsort Memory: 40kB
|
|
Buffers: shared hit=1567
|
|
-> Bitmap Heap Scan on messages (cost=674.15..4349.24 rows=16994 width=171) (actual time=1.094..6.629 rows=29999 loops=1)
|
|
Recheck Cond: (chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid)
|
|
Filter: (ROW(created_at, id) > ROW('2026-10-02 06:45:15.998444+00'::timestamp with time zone, '7df96ec6-9cae-4a9d-9696-c854f9218ab5'::uuid))
|
|
Rows Removed by Filter: 30001
|
|
Heap Blocks: exact=1508
|
|
Buffers: shared hit=1561
|
|
-> Bitmap Index Scan on ix_chat (cost=0.00..669.90 rows=59948 width=0) (actual time=0.923..0.923 rows=60000 loops=1)
|
|
Index Cond: (chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid)
|
|
Buffers: shared hit=53
|
|
Planning:
|
|
Buffers: shared hit=125
|
|
Planning Time: 0.555 ms
|
|
Execution Time: 8.615 ms
|
|
(19 rows)
|
|
|
|
===== V1_chat_id / first_page_big_chat (медиана 8.781 мс из 9) =====
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=5574.55..5580.42 rows=51 width=171) (actual time=7.829..10.288 rows=51 loops=1)
|
|
Buffers: shared hit=2670
|
|
-> Gather Merge (cost=5574.55..9629.91 rows=35264 width=171) (actual time=7.827..10.282 rows=51 loops=1)
|
|
Workers Planned: 1
|
|
Workers Launched: 1
|
|
Buffers: shared hit=2670
|
|
-> Sort (cost=4574.54..4662.70 rows=35264 width=171) (actual time=6.300..6.303 rows=51 loops=2)
|
|
Sort Key: created_at, id
|
|
Sort Method: top-N heapsort Memory: 40kB
|
|
Buffers: shared hit=2670
|
|
Worker 0: Sort Method: top-N heapsort Memory: 39kB
|
|
-> Parallel Seq Scan on messages (cost=0.00..3398.06 rows=35264 width=171) (actual time=0.007..4.247 rows=30000 loops=2)
|
|
Filter: (chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid)
|
|
Rows Removed by Filter: 22500
|
|
Buffers: shared hit=2626
|
|
Planning:
|
|
Buffers: shared hit=126
|
|
Planning Time: 0.622 ms
|
|
Execution Time: 10.363 ms
|
|
(19 rows)
|
|
|
|
===== V1_chat_id / offset_big_chat_30000 (медиана 22.723 мс из 9) =====
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=13525.04..13530.91 rows=51 width=171) (actual time=19.289..21.512 rows=51 loops=1)
|
|
Buffers: shared hit=2670, temp read=1089 written=1371
|
|
-> Gather Merge (cost=10075.04..14130.40 rows=35264 width=171) (actual time=13.620..20.895 rows=30051 loops=1)
|
|
Workers Planned: 1
|
|
Workers Launched: 1
|
|
Buffers: shared hit=2670, temp read=1089 written=1371
|
|
-> Sort (cost=9075.03..9163.19 rows=35264 width=171) (actual time=11.849..13.263 rows=15164 loops=2)
|
|
Sort Key: created_at, id
|
|
Sort Method: external merge Disk: 5976kB
|
|
Buffers: shared hit=2670, temp read=1089 written=1371
|
|
Worker 0: Sort Method: external merge Disk: 4960kB
|
|
-> Parallel Seq Scan on messages (cost=0.00..3398.06 rows=35264 width=171) (actual time=0.006..3.514 rows=30000 loops=2)
|
|
Filter: (chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid)
|
|
Rows Removed by Filter: 22500
|
|
Buffers: shared hit=2626
|
|
Planning:
|
|
Buffers: shared hit=126
|
|
Planning Time: 0.514 ms
|
|
Execution Time: 22.164 ms
|
|
(19 rows)
|
|
|
|
===== V1_chat_id / first_page_small_chat (медиана 0.063 мс из 9) =====
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=46.57..46.60 rows=11 width=171) (actual time=0.039..0.040 rows=10 loops=1)
|
|
Buffers: shared hit=9
|
|
-> Sort (cost=46.57..46.60 rows=11 width=171) (actual time=0.038..0.039 rows=10 loops=1)
|
|
Sort Key: created_at, id
|
|
Sort Method: quicksort Memory: 27kB
|
|
Buffers: shared hit=9
|
|
-> Bitmap Heap Scan on messages (cost=4.38..46.38 rows=11 width=171) (actual time=0.012..0.012 rows=10 loops=1)
|
|
Recheck Cond: (chat_id = 'b8b701bf-339f-44c0-9468-9e10800583fe'::uuid)
|
|
Heap Blocks: exact=1
|
|
Buffers: shared hit=3
|
|
-> Bitmap Index Scan on ix_chat (cost=0.00..4.38 rows=11 width=0) (actual time=0.007..0.007 rows=10 loops=1)
|
|
Index Cond: (chat_id = 'b8b701bf-339f-44c0-9468-9e10800583fe'::uuid)
|
|
Buffers: shared hit=2
|
|
Planning:
|
|
Buffers: shared hit=126
|
|
Planning Time: 0.475 ms
|
|
Execution Time: 0.063 ms
|
|
(17 rows)
|
|
|
|
===== V2_chat_created_id / keyset_big_chat_middle (медиана 0.076 мс из 9) =====
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=0.42..34.02 rows=51 width=171) (actual time=0.022..0.033 rows=51 loops=1)
|
|
Buffers: shared hit=6
|
|
-> Index Scan using ix_hist on messages (cost=0.42..11340.82 rows=17213 width=171) (actual time=0.021..0.030 rows=51 loops=1)
|
|
Index Cond: ((chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid) AND (ROW(created_at, id) > ROW('2026-10-02 06:45:15.998444+00'::timestamp with time zone, '7df96ec6-9cae-4a9d-9696-c854f9218ab5'::uuid)))
|
|
Buffers: shared hit=6
|
|
Planning:
|
|
Buffers: shared hit=136
|
|
Planning Time: 0.608 ms
|
|
Execution Time: 0.067 ms
|
|
(9 rows)
|
|
|
|
===== V2_chat_created_id / first_page_big_chat (медиана 0.043 мс из 9) =====
|
|
QUERY PLAN
|
|
-----------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=0.42..11.65 rows=51 width=171) (actual time=0.013..0.021 rows=51 loops=1)
|
|
Buffers: shared hit=5
|
|
-> Index Scan using ix_hist on messages (cost=0.42..13298.21 rows=60389 width=171) (actual time=0.012..0.018 rows=51 loops=1)
|
|
Index Cond: (chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid)
|
|
Buffers: shared hit=5
|
|
Planning:
|
|
Buffers: shared hit=137
|
|
Planning Time: 0.516 ms
|
|
Execution Time: 0.038 ms
|
|
(9 rows)
|
|
|
|
===== V2_chat_created_id / offset_big_chat_30000 (медиана 3.492 мс из 9) =====
|
|
QUERY PLAN
|
|
--------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=6606.48..6617.71 rows=51 width=171) (actual time=3.347..3.355 rows=51 loops=1)
|
|
Buffers: shared hit=1234
|
|
-> Index Scan using ix_hist on messages (cost=0.42..13298.21 rows=60389 width=171) (actual time=0.016..2.753 rows=30051 loops=1)
|
|
Index Cond: (chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid)
|
|
Buffers: shared hit=1234
|
|
Planning:
|
|
Buffers: shared hit=137
|
|
Planning Time: 0.556 ms
|
|
Execution Time: 3.378 ms
|
|
(9 rows)
|
|
|
|
===== V2_chat_created_id / first_page_small_chat (медиана 0.07 мс из 9) =====
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=46.69..46.72 rows=11 width=171) (actual time=0.057..0.058 rows=10 loops=1)
|
|
Buffers: shared hit=10
|
|
-> Sort (cost=46.69..46.72 rows=11 width=171) (actual time=0.055..0.056 rows=10 loops=1)
|
|
Sort Key: created_at, id
|
|
Sort Method: quicksort Memory: 27kB
|
|
Buffers: shared hit=10
|
|
-> Bitmap Heap Scan on messages (cost=4.50..46.50 rows=11 width=171) (actual time=0.023..0.023 rows=10 loops=1)
|
|
Recheck Cond: (chat_id = 'b8b701bf-339f-44c0-9468-9e10800583fe'::uuid)
|
|
Heap Blocks: exact=1
|
|
Buffers: shared hit=4
|
|
-> Bitmap Index Scan on ix_hist (cost=0.00..4.50 rows=11 width=0) (actual time=0.013..0.013 rows=10 loops=1)
|
|
Index Cond: (chat_id = 'b8b701bf-339f-44c0-9468-9e10800583fe'::uuid)
|
|
Buffers: shared hit=3
|
|
Planning:
|
|
Buffers: shared hit=137
|
|
Planning Time: 0.785 ms
|
|
Execution Time: 0.090 ms
|
|
(17 rows)
|
|
|
|
===== V3_chat_created_id_include / keyset_big_chat_middle (медиана 0.068 мс из 9) =====
|
|
QUERY PLAN
|
|
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=0.42..34.11 rows=51 width=171) (actual time=0.026..0.033 rows=51 loops=1)
|
|
Buffers: shared hit=5
|
|
-> Index Scan using ix_hist_inc on messages (cost=0.42..11506.55 rows=17419 width=171) (actual time=0.025..0.029 rows=51 loops=1)
|
|
Index Cond: ((chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid) AND (ROW(created_at, id) > ROW('2026-10-02 06:45:15.998444+00'::timestamp with time zone, '7df96ec6-9cae-4a9d-9696-c854f9218ab5'::uuid)))
|
|
Buffers: shared hit=5
|
|
Planning:
|
|
Buffers: shared hit=139
|
|
Planning Time: 0.586 ms
|
|
Execution Time: 0.095 ms
|
|
(9 rows)
|
|
|
|
===== V3_chat_created_id_include / first_page_big_chat (медиана 0.042 мс из 9) =====
|
|
QUERY PLAN
|
|
---------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=0.42..12.14 rows=51 width=171) (actual time=0.013..0.024 rows=51 loops=1)
|
|
Buffers: shared hit=6
|
|
-> Index Scan using ix_hist_inc on messages (cost=0.42..13823.52 rows=60154 width=171) (actual time=0.013..0.021 rows=51 loops=1)
|
|
Index Cond: (chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid)
|
|
Buffers: shared hit=6
|
|
Planning:
|
|
Buffers: shared hit=140
|
|
Planning Time: 0.581 ms
|
|
Execution Time: 0.052 ms
|
|
(9 rows)
|
|
|
|
===== V3_chat_created_id_include / offset_big_chat_30000 (медиана 3.587 мс из 9) =====
|
|
QUERY PLAN
|
|
------------------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=6894.28..6906.00 rows=51 width=171) (actual time=3.503..3.509 rows=51 loops=1)
|
|
Buffers: shared hit=1300
|
|
-> Index Scan using ix_hist_inc on messages (cost=0.42..13823.52 rows=60154 width=171) (actual time=0.011..2.892 rows=30051 loops=1)
|
|
Index Cond: (chat_id = 'ae663d40-43bf-4930-94b0-07eef693fca2'::uuid)
|
|
Buffers: shared hit=1300
|
|
Planning:
|
|
Buffers: shared hit=140
|
|
Planning Time: 0.513 ms
|
|
Execution Time: 3.529 ms
|
|
(9 rows)
|
|
|
|
===== V3_chat_created_id_include / first_page_small_chat (медиана 0.075 мс из 9) =====
|
|
QUERY PLAN
|
|
----------------------------------------------------------------------------------------------------------------------------------
|
|
Limit (cost=42.93..42.96 rows=10 width=171) (actual time=0.064..0.066 rows=10 loops=1)
|
|
Buffers: shared hit=10
|
|
-> Sort (cost=42.93..42.96 rows=10 width=171) (actual time=0.063..0.064 rows=10 loops=1)
|
|
Sort Key: created_at, id
|
|
Sort Method: quicksort Memory: 27kB
|
|
Buffers: shared hit=10
|
|
-> Bitmap Heap Scan on messages (cost=4.50..42.77 rows=10 width=171) (actual time=0.023..0.024 rows=10 loops=1)
|
|
Recheck Cond: (chat_id = 'b8b701bf-339f-44c0-9468-9e10800583fe'::uuid)
|
|
Heap Blocks: exact=1
|
|
Buffers: shared hit=4
|
|
-> Bitmap Index Scan on ix_hist_inc (cost=0.00..4.49 rows=10 width=0) (actual time=0.014..0.014 rows=10 loops=1)
|
|
Index Cond: (chat_id = 'b8b701bf-339f-44c0-9468-9e10800583fe'::uuid)
|
|
Buffers: shared hit=3
|
|
Planning:
|
|
Buffers: shared hit=140
|
|
Planning Time: 0.564 ms
|
|
Execution Time: 0.112 ms
|
|
(17 rows)
|