date: 2026-10-28T17:18:31.130Z  commit: 6468ee2  17.11
EXPLAIN (ANALYZE, BUFFERS) при plan_cache_mode = force_custom_plan

=== none | largest (284708 сообщений) | first | тёплый кэш
Limit  (cost=35863.74..35869.69 rows=51 width=176) (actual time=19.687..21.080 rows=51 loops=1)
  Buffers: shared hit=14320 read=11464
  ->  Gather Merge  (cost=35863.74..63557.67 rows=237360 width=176) (actual time=19.686..21.077 rows=51 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=14320 read=11464
        ->  Sort  (cost=34863.71..35160.41 rows=118680 width=176) (actual time=18.751..18.753 rows=51 loops=3)
              Sort Key: created_at, id
              Sort Method: top-N heapsort  Memory: 38kB
              Buffers: shared hit=14320 read=11464
              Worker 0:  Sort Method: top-N heapsort  Memory: 38kB
              Worker 1:  Sort Method: top-N heapsort  Memory: 38kB
              ->  Parallel Seq Scan on messages  (cost=0.00..30904.30 rows=118680 width=176) (actual time=0.013..14.715 rows=94903 loops=3)
                    Filter: (chat_id = '00000000-0000-7000-8000-000000000001'::uuid)
                    Rows Removed by Filter: 238428
                    Buffers: shared hit=14232 read=11464
Planning Time: 0.059 ms
Execution Time: 21.103 ms

=== none | largest (284708 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=34387.32..34393.27 rows=51 width=176) (actual time=17.737..18.764 rows=51 loops=1)
  Buffers: shared hit=702 read=25024
  ->  Gather Merge  (cost=34387.32..37182.85 rows=23960 width=176) (actual time=17.736..18.761 rows=51 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=702 read=25024
        ->  Sort  (cost=33387.29..33417.24 rows=11980 width=176) (actual time=16.550..16.551 rows=34 loops=3)
              Sort Key: created_at, id
              Sort Method: top-N heapsort  Memory: 38kB
              Buffers: shared hit=702 read=25024
              Worker 0:  Sort Method: top-N heapsort  Memory: 38kB
              Worker 1:  Sort Method: top-N heapsort  Memory: 38kB
              ->  Parallel Seq Scan on messages  (cost=0.00..32987.62 rows=11980 width=176) (actual time=5.403..16.125 rows=9490 loops=3)
                    Filter: ((chat_id = '00000000-0000-7000-8000-000000000001'::uuid) AND (ROW(created_at, id) > ROW('2026-01-27 23:59:58.179187+00'::timestamp with time zone, '00000001-0000-7000-8002-00000003e8ed'::uuid)))
                    Rows Removed by Filter: 323841
                    Buffers: shared hit=672 read=25024
Planning Time: 0.083 ms
Execution Time: 18.778 ms

=== none | largest (284708 сообщений) | offset_deep | тёплый кэш
Limit  (cost=79744.03..79744.15 rows=1 width=176) (actual time=58.869..60.326 rows=51 loops=1)
  Buffers: shared hit=760 read=25024, temp read=6161 written=6660
  ->  Gather Merge  (cost=52050.10..79744.03 rows=237360 width=176) (actual time=26.697..55.317 rows=256288 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=760 read=25024, temp read=6161 written=6660
        ->  Sort  (cost=51050.07..51346.77 rows=118680 width=176) (actual time=25.251..31.125 rows=85598 loops=3)
              Sort Key: created_at, id
              Sort Method: external merge  Disk: 18360kB
              Buffers: shared hit=760 read=25024, temp read=6161 written=6660
              Worker 0:  Sort Method: external merge  Disk: 16632kB
              Worker 1:  Sort Method: external merge  Disk: 18144kB
              ->  Parallel Seq Scan on messages  (cost=0.00..30904.30 rows=118680 width=176) (actual time=0.018..14.215 rows=94903 loops=3)
                    Filter: (chat_id = '00000000-0000-7000-8000-000000000001'::uuid)
                    Rows Removed by Filter: 238428
                    Buffers: shared hit=672 read=25024
Planning Time: 0.074 ms
Execution Time: 60.862 ms

=== none | chat_50 (1761 сообщений) | first | тёплый кэш
Limit  (cost=31923.34..31929.29 rows=51 width=176) (actual time=13.382..14.353 rows=51 loops=1)
  Buffers: shared hit=760 read=25024
  ->  Gather Merge  (cost=31923.34..32056.35 rows=1140 width=176) (actual time=13.381..14.350 rows=51 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=760 read=25024
        ->  Sort  (cost=30923.31..30924.74 rows=570 width=176) (actual time=12.427..12.429 rows=51 loops=3)
              Sort Key: created_at, id
              Sort Method: top-N heapsort  Memory: 38kB
              Buffers: shared hit=760 read=25024
              Worker 0:  Sort Method: top-N heapsort  Memory: 38kB
              Worker 1:  Sort Method: top-N heapsort  Memory: 38kB
              ->  Parallel Seq Scan on messages  (cost=0.00..30904.30 rows=570 width=176) (actual time=10.425..12.342 rows=587 loops=3)
                    Filter: (chat_id = '00000000-0000-7000-8000-000000000032'::uuid)
                    Rows Removed by Filter: 332744
                    Buffers: shared hit=672 read=25024
Planning Time: 0.070 ms
Execution Time: 14.366 ms

=== none | chat_50 (1761 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=33989.34..33995.29 rows=51 width=176) (actual time=14.321..15.468 rows=51 loops=1)
  Buffers: shared hit=702 read=25024
  ->  Gather Merge  (cost=33989.34..34002.87 rows=116 width=176) (actual time=14.321..15.465 rows=51 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=702 read=25024
        ->  Sort  (cost=32989.31..32989.46 rows=58 width=176) (actual time=13.344..13.345 rows=17 loops=3)
              Sort Key: created_at, id
              Sort Method: top-N heapsort  Memory: 38kB
              Buffers: shared hit=702 read=25024
              Worker 0:  Sort Method: quicksort  Memory: 25kB
              Worker 1:  Sort Method: quicksort  Memory: 25kB
              ->  Parallel Seq Scan on messages  (cost=0.00..32987.62 rows=58 width=176) (actual time=12.630..13.319 rows=59 loops=3)
                    Filter: ((chat_id = '00000000-0000-7000-8000-000000000032'::uuid) AND (ROW(created_at, id) > ROW('2026-01-27 23:37:55.298126+00'::timestamp with time zone, '00000032-0000-7000-8002-000000000630'::uuid)))
                    Rows Removed by Filter: 333272
                    Buffers: shared hit=672 read=25024
Planning Time: 0.067 ms
Execution Time: 15.485 ms

=== none | chat_50 (1761 сообщений) | offset_deep | тёплый кэш
Limit  (cost=32063.42..32063.54 rows=1 width=176) (actual time=15.830..16.873 rows=51 loops=1)
  Buffers: shared hit=760 read=25024
  ->  Gather Merge  (cost=31930.41..32063.42 rows=1140 width=176) (actual time=15.600..16.837 rows=1635 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=760 read=25024
        ->  Sort  (cost=30930.39..30931.81 rows=570 width=176) (actual time=14.374..14.389 rows=587 loops=3)
              Sort Key: created_at, id
              Sort Method: quicksort  Memory: 185kB
              Buffers: shared hit=760 read=25024
              Worker 0:  Sort Method: quicksort  Memory: 186kB
              Worker 1:  Sort Method: quicksort  Memory: 157kB
              ->  Parallel Seq Scan on messages  (cost=0.00..30904.30 rows=570 width=176) (actual time=11.973..14.250 rows=587 loops=3)
                    Filter: (chat_id = '00000000-0000-7000-8000-000000000032'::uuid)
                    Rows Removed by Filter: 332744
                    Buffers: shared hit=672 read=25024
Planning Time: 0.096 ms
Execution Time: 16.898 ms

=== none | smallest (36 сообщений) | first | тёплый кэш
Limit  (cost=31906.17..31912.12 rows=51 width=176) (actual time=13.734..14.652 rows=36 loops=1)
  Buffers: shared hit=760 read=25024
  ->  Gather Merge  (cost=31906.17..31920.63 rows=124 width=176) (actual time=13.733..14.648 rows=36 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=760 read=25024
        ->  Sort  (cost=30906.14..30906.30 rows=62 width=176) (actual time=12.758..12.758 rows=12 loops=3)
              Sort Key: created_at, id
              Sort Method: quicksort  Memory: 26kB
              Buffers: shared hit=760 read=25024
              Worker 0:  Sort Method: quicksort  Memory: 25kB
              Worker 1:  Sort Method: quicksort  Memory: 32kB
              ->  Parallel Seq Scan on messages  (cost=0.00..30904.30 rows=62 width=176) (actual time=12.709..12.709 rows=12 loops=3)
                    Filter: (chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid)
                    Rows Removed by Filter: 333319
                    Buffers: shared hit=672 read=25024
Planning Time: 0.066 ms
Execution Time: 14.661 ms

=== none | smallest (36 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=33987.74..33989.37 rows=14 width=176) (actual time=15.901..16.837 rows=4 loops=1)
  Buffers: shared hit=702 read=25024
  ->  Gather Merge  (cost=33987.74..33989.37 rows=14 width=176) (actual time=15.900..16.836 rows=4 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=702 read=25024
        ->  Sort  (cost=32987.71..32987.73 rows=7 width=176) (actual time=14.760..14.760 rows=1 loops=3)
              Sort Key: created_at, id
              Sort Method: quicksort  Memory: 25kB
              Buffers: shared hit=702 read=25024
              Worker 0:  Sort Method: quicksort  Memory: 26kB
              Worker 1:  Sort Method: quicksort  Memory: 25kB
              ->  Parallel Seq Scan on messages  (cost=0.00..32987.62 rows=7 width=176) (actual time=14.740..14.741 rows=1 loops=3)
                    Filter: ((chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid) AND (ROW(created_at, id) > ROW('2026-01-27 16:00:00+00'::timestamp with time zone, '000003e8-0000-7000-8002-000000000020'::uuid)))
                    Rows Removed by Filter: 333330
                    Buffers: shared hit=672 read=25024
Planning Time: 0.106 ms
Execution Time: 16.849 ms

=== none | smallest (36 сообщений) | offset_deep | тёплый кэш
Limit  (cost=31909.90..31915.85 rows=51 width=176) (actual time=13.819..14.716 rows=4 loops=1)
  Buffers: shared hit=760 read=25024
  ->  Gather Merge  (cost=31906.17..31920.63 rows=124 width=176) (actual time=13.806..14.706 rows=36 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=760 read=25024
        ->  Sort  (cost=30906.14..30906.30 rows=62 width=176) (actual time=12.679..12.679 rows=12 loops=3)
              Sort Key: created_at, id
              Sort Method: quicksort  Memory: 26kB
              Buffers: shared hit=760 read=25024
              Worker 0:  Sort Method: quicksort  Memory: 25kB
              Worker 1:  Sort Method: quicksort  Memory: 32kB
              ->  Parallel Seq Scan on messages  (cost=0.00..30904.30 rows=62 width=176) (actual time=12.627..12.628 rows=12 loops=3)
                    Filter: (chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid)
                    Rows Removed by Filter: 333319
                    Buffers: shared hit=672 read=25024
Planning Time: 0.075 ms
Execution Time: 14.727 ms

=== chat_id | largest (284708 сообщений) | first | тёплый кэш
Limit  (cost=16437.64..16443.59 rows=51 width=176) (actual time=10.754..11.724 rows=51 loops=1)
  Buffers: shared hit=7866
  ->  Gather Merge  (cost=16437.64..43836.62 rows=234832 width=176) (actual time=10.754..11.722 rows=51 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=7866
        ->  Sort  (cost=15437.62..15731.16 rows=117416 width=176) (actual time=9.806..9.807 rows=51 loops=3)
              Sort Key: created_at, id
              Sort Method: top-N heapsort  Memory: 38kB
              Buffers: shared hit=7866
              Worker 0:  Sort Method: top-N heapsort  Memory: 38kB
              Worker 1:  Sort Method: top-N heapsort  Memory: 38kB
              ->  Parallel Index Scan using track_chat_idx on messages  (cost=0.42..11520.37 rows=117416 width=176) (actual time=0.006..5.561 rows=94903 loops=3)
                    Index Cond: (chat_id = '00000000-0000-7000-8000-000000000001'::uuid)
                    Buffers: shared hit=7836
Planning Time: 0.068 ms
Execution Time: 11.738 ms

=== chat_id | largest (284708 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=13498.08..13504.03 rows=51 width=176) (actual time=6.926..7.877 rows=51 loops=1)
  Buffers: shared hit=7848
  ->  Gather Merge  (cost=13498.08..16230.14 rows=23416 width=176) (actual time=6.925..7.874 rows=51 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=7848
        ->  Sort  (cost=12498.05..12527.32 rows=11708 width=176) (actual time=5.778..5.779 rows=51 loops=3)
              Sort Key: created_at, id
              Sort Method: top-N heapsort  Memory: 38kB
              Buffers: shared hit=7848
              Worker 0:  Sort Method: top-N heapsort  Memory: 38kB
              Worker 1:  Sort Method: top-N heapsort  Memory: 38kB
              ->  Parallel Index Scan using track_chat_idx on messages  (cost=0.42..12107.45 rows=11708 width=176) (actual time=4.661..5.364 rows=9490 loops=3)
                    Index Cond: (chat_id = '00000000-0000-7000-8000-000000000001'::uuid)
                    Filter: (ROW(created_at, id) > ROW('2026-01-27 23:59:58.179187+00'::timestamp with time zone, '00000001-0000-7000-8002-00000003e8ed'::uuid))
                    Rows Removed by Filter: 85412
                    Buffers: shared hit=7818
Planning Time: 0.087 ms
Execution Time: 7.900 ms

=== chat_id | largest (284708 сообщений) | offset_deep | тёплый кэш
Limit  (cost=59841.05..59841.16 rows=1 width=176) (actual time=56.297..59.389 rows=51 loops=1)
  Buffers: shared hit=7849, temp read=6290 written=6665
  ->  Gather Merge  (cost=32442.07..59841.05 rows=234832 width=176) (actual time=20.056..54.066 rows=256288 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=7849, temp read=6290 written=6665
        ->  Sort  (cost=31442.04..31735.58 rows=117416 width=176) (actual time=18.834..24.515 rows=85603 loops=3)
              Sort Key: created_at, id
              Sort Method: external merge  Disk: 19728kB
              Buffers: shared hit=7849, temp read=6290 written=6665
              Worker 0:  Sort Method: external merge  Disk: 16616kB
              Worker 1:  Sort Method: external merge  Disk: 16824kB
              ->  Parallel Index Scan using track_chat_idx on messages  (cost=0.42..11520.37 rows=117416 width=176) (actual time=0.014..6.727 rows=94903 loops=3)
                    Index Cond: (chat_id = '00000000-0000-7000-8000-000000000001'::uuid)
                    Buffers: shared hit=7819
Planning Time: 0.104 ms
Execution Time: 60.257 ms

=== chat_id | chat_50 (1761 сообщений) | first | тёплый кэш
Limit  (cost=139.43..139.56 rows=51 width=176) (actual time=0.197..0.200 rows=51 loops=1)
  Buffers: shared hit=50
  ->  Sort  (cost=139.43..143.60 rows=1667 width=176) (actual time=0.197..0.198 rows=51 loops=1)
        Sort Key: created_at, id
        Sort Method: top-N heapsort  Memory: 38kB
        Buffers: shared hit=50
        ->  Index Scan using track_chat_idx on messages  (cost=0.42..83.82 rows=1667 width=176) (actual time=0.010..0.109 rows=1761 loops=1)
              Index Cond: (chat_id = '00000000-0000-7000-8000-000000000032'::uuid)
              Buffers: shared hit=50
Planning Time: 0.064 ms
Execution Time: 0.211 ms

=== chat_id | chat_50 (1761 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=97.73..97.85 rows=51 width=176) (actual time=0.095..0.098 rows=51 loops=1)
  Buffers: shared hit=50
  ->  Sort  (cost=97.73..98.14 rows=167 width=176) (actual time=0.095..0.097 rows=51 loops=1)
        Sort Key: created_at, id
        Sort Method: top-N heapsort  Memory: 38kB
        Buffers: shared hit=50
        ->  Index Scan using track_chat_idx on messages  (cost=0.42..92.15 rows=167 width=176) (actual time=0.072..0.083 rows=177 loops=1)
              Index Cond: (chat_id = '00000000-0000-7000-8000-000000000032'::uuid)
              Filter: (ROW(created_at, id) > ROW('2026-01-27 23:37:55.298126+00'::timestamp with time zone, '00000032-0000-7000-8002-000000000630'::uuid))
              Rows Removed by Filter: 1584
              Buffers: shared hit=50
Planning Time: 0.024 ms
Execution Time: 0.105 ms

=== chat_id | chat_50 (1761 сообщений) | offset_deep | тёплый кэш
Limit  (cost=176.99..177.12 rows=51 width=176) (actual time=0.300..0.304 rows=51 loops=1)
  Buffers: shared hit=50
  ->  Sort  (cost=173.03..177.20 rows=1667 width=176) (actual time=0.232..0.270 rows=1635 loops=1)
        Sort Key: created_at, id
        Sort Method: quicksort  Memory: 503kB
        Buffers: shared hit=50
        ->  Index Scan using track_chat_idx on messages  (cost=0.42..83.82 rows=1667 width=176) (actual time=0.004..0.086 rows=1761 loops=1)
              Index Cond: (chat_id = '00000000-0000-7000-8000-000000000032'::uuid)
              Buffers: shared hit=50
Planning Time: 0.022 ms
Execution Time: 0.320 ms

=== chat_id | smallest (36 сообщений) | first | тёплый кэш
Limit  (cost=19.13..19.25 rows=51 width=176) (actual time=0.012..0.014 rows=36 loops=1)
  Buffers: shared hit=5
  ->  Sort  (cost=19.13..19.50 rows=151 width=176) (actual time=0.011..0.012 rows=36 loops=1)
        Sort Key: created_at, id
        Sort Method: quicksort  Memory: 34kB
        Buffers: shared hit=5
        ->  Index Scan using track_chat_idx on messages  (cost=0.42..14.09 rows=151 width=176) (actual time=0.005..0.007 rows=36 loops=1)
              Index Cond: (chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid)
              Buffers: shared hit=5
Planning Time: 0.037 ms
Execution Time: 0.023 ms

=== chat_id | smallest (36 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=15.19..15.23 rows=17 width=176) (actual time=0.012..0.013 rows=4 loops=1)
  Buffers: shared hit=5
  ->  Sort  (cost=15.19..15.23 rows=17 width=176) (actual time=0.012..0.012 rows=4 loops=1)
        Sort Key: created_at, id
        Sort Method: quicksort  Memory: 26kB
        Buffers: shared hit=5
        ->  Index Scan using track_chat_idx on messages  (cost=0.42..14.84 rows=17 width=176) (actual time=0.008..0.008 rows=4 loops=1)
              Index Cond: (chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid)
              Filter: (ROW(created_at, id) > ROW('2026-01-27 16:00:00+00'::timestamp with time zone, '000003e8-0000-7000-8002-000000000020'::uuid))
              Rows Removed by Filter: 32
              Buffers: shared hit=5
Planning Time: 0.076 ms
Execution Time: 0.021 ms

=== chat_id | smallest (36 сообщений) | offset_deep | тёплый кэш
Limit  (cost=19.63..19.76 rows=51 width=176) (actual time=0.017..0.018 rows=4 loops=1)
  Buffers: shared hit=5
  ->  Sort  (cost=19.55..19.93 rows=151 width=176) (actual time=0.016..0.017 rows=36 loops=1)
        Sort Key: created_at, id
        Sort Method: quicksort  Memory: 34kB
        Buffers: shared hit=5
        ->  Index Scan using track_chat_idx on messages  (cost=0.42..14.09 rows=151 width=176) (actual time=0.008..0.010 rows=36 loops=1)
              Index Cond: (chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid)
              Buffers: shared hit=5
Planning Time: 0.070 ms
Execution Time: 0.026 ms

=== created_at_id | largest (284708 сообщений) | first | тёплый кэш
Limit  (cost=0.42..25.26 rows=51 width=176) (actual time=0.010..0.031 rows=51 loops=1)
  Buffers: shared hit=113
  ->  Index Scan using track_time_idx on messages  (cost=0.42..139575.12 rows=286631 width=176) (actual time=0.010..0.028 rows=51 loops=1)
        Filter: (chat_id = '00000000-0000-7000-8000-000000000001'::uuid)
        Rows Removed by Filter: 73
        Buffers: shared hit=113
Planning Time: 0.053 ms
Execution Time: 0.039 ms

=== created_at_id | largest (284708 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=0.42..188.15 rows=51 width=176) (actual time=0.027..0.052 rows=51 loops=1)
  Buffers: shared hit=251
  ->  Index Scan using track_time_idx on messages  (cost=0.42..106136.95 rows=28835 width=176) (actual time=0.027..0.049 rows=51 loops=1)
        Index Cond: (ROW(created_at, id) > ROW('2026-01-27 23:59:58.179187+00'::timestamp with time zone, '00000001-0000-7000-8002-00000003e8ed'::uuid))
        Filter: (chat_id = '00000000-0000-7000-8000-000000000001'::uuid)
        Rows Removed by Filter: 200
        Buffers: shared hit=251
Planning Time: 0.035 ms
Execution Time: 0.058 ms

=== created_at_id | largest (284708 сообщений) | offset_deep | тёплый кэш
Limit  (cost=80050.68..80050.80 rows=1 width=176) (actual time=59.207..60.934 rows=51 loops=1)
  Buffers: shared hit=807 read=24977, temp read=6253 written=6661
  ->  Gather Merge  (cost=52181.74..80050.68 rows=238860 width=176) (actual time=26.737..55.792 rows=256288 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=807 read=24977, temp read=6253 written=6661
        ->  Sort  (cost=51181.71..51480.29 rows=119430 width=176) (actual time=25.560..31.143 rows=85575 loops=3)
              Sort Key: created_at, id
              Sort Method: external merge  Disk: 18736kB
              Buffers: shared hit=807 read=24977, temp read=6253 written=6661
              Worker 0:  Sort Method: external merge  Disk: 16960kB
              Worker 1:  Sort Method: external merge  Disk: 17440kB
              ->  Parallel Seq Scan on messages  (cost=0.00..30904.30 rows=119430 width=176) (actual time=0.016..14.329 rows=94903 loops=3)
                    Filter: (chat_id = '00000000-0000-7000-8000-000000000001'::uuid)
                    Rows Removed by Filter: 238428
                    Buffers: shared hit=719 read=24977
Planning Time: 0.097 ms
Execution Time: 61.612 ms

=== created_at_id | chat_50 (1761 сообщений) | first | тёплый кэш
Limit  (cost=0.42..3813.12 rows=51 width=176) (actual time=0.065..3.258 rows=51 loops=1)
  Buffers: shared hit=28010
  ->  Index Scan using track_time_idx on messages  (cost=0.42..139575.12 rows=1867 width=176) (actual time=0.065..3.254 rows=51 loops=1)
        Filter: (chat_id = '00000000-0000-7000-8000-000000000032'::uuid)
        Rows Removed by Filter: 28460
        Buffers: shared hit=28010
Planning Time: 0.053 ms
Execution Time: 3.268 ms

=== created_at_id | chat_50 (1761 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=0.42..28646.45 rows=51 width=176) (actual time=0.099..3.240 rows=51 loops=1)
  Buffers: shared hit=28414
  ->  Index Scan using track_time_idx on messages  (cost=0.42..106159.22 rows=189 width=176) (actual time=0.099..3.236 rows=51 loops=1)
        Index Cond: (ROW(created_at, id) > ROW('2026-01-27 23:37:55.298126+00'::timestamp with time zone, '00000032-0000-7000-8002-000000000630'::uuid))
        Filter: (chat_id = '00000000-0000-7000-8000-000000000032'::uuid)
        Rows Removed by Filter: 28907
        Buffers: shared hit=28414
Planning Time: 0.038 ms
Execution Time: 3.251 ms

=== created_at_id | chat_50 (1761 сообщений) | offset_deep | тёплый кэш
Limit  (cost=32123.22..32123.34 rows=1 width=176) (actual time=14.536..15.478 rows=51 loops=1)
  Buffers: shared hit=2431 read=23353
  ->  Gather Merge  (cost=31941.68..32123.22 rows=1556 width=176) (actual time=14.355..15.443 rows=1635 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=2431 read=23353
        ->  Sort  (cost=30941.65..30943.60 rows=778 width=176) (actual time=13.244..13.265 rows=587 loops=3)
              Sort Key: created_at, id
              Sort Method: quicksort  Memory: 185kB
              Buffers: shared hit=2431 read=23353
              Worker 0:  Sort Method: quicksort  Memory: 157kB
              Worker 1:  Sort Method: quicksort  Memory: 186kB
              ->  Parallel Seq Scan on messages  (cost=0.00..30904.30 rows=778 width=176) (actual time=10.936..13.123 rows=587 loops=3)
                    Filter: (chat_id = '00000000-0000-7000-8000-000000000032'::uuid)
                    Rows Removed by Filter: 332744
                    Buffers: shared hit=2343 read=23353
Planning Time: 0.099 ms
Execution Time: 15.503 ms

=== created_at_id | smallest (36 сообщений) | first | тёплый кэш
Limit  (cost=31906.17..31912.12 rows=51 width=176) (actual time=13.930..15.035 rows=36 loops=1)
  Buffers: shared hit=760 read=25024
  ->  Gather Merge  (cost=31906.17..31920.63 rows=124 width=176) (actual time=13.929..15.033 rows=36 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=760 read=25024
        ->  Sort  (cost=30906.14..30906.30 rows=62 width=176) (actual time=12.920..12.920 rows=12 loops=3)
              Sort Key: created_at, id
              Sort Method: quicksort  Memory: 32kB
              Buffers: shared hit=760 read=25024
              Worker 0:  Sort Method: quicksort  Memory: 26kB
              Worker 1:  Sort Method: quicksort  Memory: 25kB
              ->  Parallel Seq Scan on messages  (cost=0.00..30904.30 rows=62 width=176) (actual time=12.870..12.871 rows=12 loops=3)
                    Filter: (chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid)
                    Rows Removed by Filter: 333319
                    Buffers: shared hit=672 read=25024
Planning Time: 0.091 ms
Execution Time: 15.047 ms

=== created_at_id | smallest (36 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=30560.11..30561.75 rows=14 width=176) (actual time=5.528..6.445 rows=4 loops=1)
  Buffers: shared hit=4524
  ->  Gather Merge  (cost=30560.11..30561.75 rows=14 width=176) (actual time=5.528..6.444 rows=4 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=4524
        ->  Sort  (cost=29560.09..29560.11 rows=7 width=176) (actual time=4.643..4.643 rows=1 loops=3)
              Sort Key: created_at, id
              Sort Method: quicksort  Memory: 25kB
              Buffers: shared hit=4524
              Worker 0:  Sort Method: quicksort  Memory: 25kB
              Worker 1:  Sort Method: quicksort  Memory: 26kB
              ->  Parallel Bitmap Heap Scan on messages  (cost=3049.84..29559.99 rows=7 width=176) (actual time=4.627..4.627 rows=1 loops=3)
                    Recheck Cond: (ROW(created_at, id) > ROW('2026-01-27 16:00:00+00'::timestamp with time zone, '000003e8-0000-7000-8002-000000000020'::uuid))
                    Filter: (chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid)
                    Rows Removed by Filter: 37186
                    Heap Blocks: exact=1618
                    Buffers: shared hit=4494
                    ->  Bitmap Index Scan on track_time_idx  (cost=0.00..3049.84 rows=111655 width=0) (actual time=3.125..3.125 rows=111561 loops=1)
                          Index Cond: (ROW(created_at, id) > ROW('2026-01-27 16:00:00+00'::timestamp with time zone, '000003e8-0000-7000-8002-000000000020'::uuid))
                          Buffers: shared hit=553
Planning Time: 0.069 ms
Execution Time: 6.464 ms

=== created_at_id | smallest (36 сообщений) | offset_deep | тёплый кэш
Limit  (cost=31909.90..31915.85 rows=51 width=176) (actual time=14.001..15.088 rows=4 loops=1)
  Buffers: shared hit=4605 read=21179
  ->  Gather Merge  (cost=31906.17..31920.63 rows=124 width=176) (actual time=13.998..15.086 rows=36 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=4605 read=21179
        ->  Sort  (cost=30906.14..30906.30 rows=62 width=176) (actual time=13.028..13.029 rows=12 loops=3)
              Sort Key: created_at, id
              Sort Method: quicksort  Memory: 25kB
              Buffers: shared hit=4605 read=21179
              Worker 0:  Sort Method: quicksort  Memory: 32kB
              Worker 1:  Sort Method: quicksort  Memory: 26kB
              ->  Parallel Seq Scan on messages  (cost=0.00..30904.30 rows=62 width=176) (actual time=12.975..12.976 rows=12 loops=3)
                    Filter: (chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid)
                    Rows Removed by Filter: 333319
                    Buffers: shared hit=4517 read=21179
Planning Time: 0.090 ms
Execution Time: 15.100 ms

=== chat_id_created_at_id | largest (284708 сообщений) | first | тёплый кэш
Limit  (cost=0.42..11.49 rows=51 width=176) (actual time=0.008..0.014 rows=51 loops=1)
  Buffers: shared hit=5
  ->  Index Scan using messages_history_idx on messages  (cost=0.42..62439.90 rows=287698 width=176) (actual time=0.008..0.011 rows=51 loops=1)
        Index Cond: (chat_id = '00000000-0000-7000-8000-000000000001'::uuid)
        Buffers: shared hit=5
Planning Time: 0.035 ms
Execution Time: 0.020 ms

=== chat_id_created_at_id | largest (284708 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=0.42..61.18 rows=51 width=176) (actual time=0.009..0.014 rows=51 loops=1)
  Buffers: shared hit=5
  ->  Index Scan using messages_history_idx on messages  (cost=0.42..33769.77 rows=28348 width=176) (actual time=0.008..0.011 rows=51 loops=1)
        Index Cond: ((chat_id = '00000000-0000-7000-8000-000000000001'::uuid) AND (ROW(created_at, id) > ROW('2026-01-27 23:59:58.179187+00'::timestamp with time zone, '00000001-0000-7000-8002-00000003e8ed'::uuid)))
        Buffers: shared hit=5
Planning Time: 0.050 ms
Execution Time: 0.023 ms

=== chat_id_created_at_id | largest (284708 сообщений) | offset_deep | тёплый кэш
Limit  (cost=55611.87..55622.94 rows=51 width=176) (actual time=21.642..21.647 rows=51 loops=1)
  Buffers: shared hit=9012
  ->  Index Scan using messages_history_idx on messages  (cost=0.42..62439.90 rows=287698 width=176) (actual time=0.011..16.618 rows=256288 loops=1)
        Index Cond: (chat_id = '00000000-0000-7000-8000-000000000001'::uuid)
        Buffers: shared hit=9012
Planning Time: 0.078 ms
Execution Time: 21.666 ms

=== chat_id_created_at_id | chat_50 (1761 сообщений) | first | тёплый кэш
Limit  (cost=0.42..90.76 rows=51 width=176) (actual time=0.006..0.011 rows=51 loops=1)
  Buffers: shared hit=5
  ->  Index Scan using messages_history_idx on messages  (cost=0.42..2303.01 rows=1300 width=176) (actual time=0.006..0.008 rows=51 loops=1)
        Index Cond: (chat_id = '00000000-0000-7000-8000-000000000032'::uuid)
        Buffers: shared hit=5
Planning Time: 0.034 ms
Execution Time: 0.018 ms

=== chat_id_created_at_id | chat_50 (1761 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=0.42..93.83 rows=51 width=176) (actual time=0.006..0.013 rows=51 loops=1)
  Buffers: shared hit=6
  ->  Index Scan using messages_history_idx on messages  (cost=0.42..236.70 rows=129 width=176) (actual time=0.006..0.011 rows=51 loops=1)
        Index Cond: ((chat_id = '00000000-0000-7000-8000-000000000032'::uuid) AND (ROW(created_at, id) > ROW('2026-01-27 23:37:55.298126+00'::timestamp with time zone, '00000032-0000-7000-8002-000000000630'::uuid)))
        Buffers: shared hit=6
Planning Time: 0.049 ms
Execution Time: 0.020 ms

=== chat_id_created_at_id | chat_50 (1761 сообщений) | offset_deep | тёплый кэш
Limit  (cost=2303.01..2304.79 rows=1 width=176) (actual time=0.158..0.164 rows=51 loops=1)
  Buffers: shared hit=64
  ->  Index Scan using messages_history_idx on messages  (cost=0.42..2303.01 rows=1300 width=176) (actual time=0.005..0.125 rows=1635 loops=1)
        Index Cond: (chat_id = '00000000-0000-7000-8000-000000000032'::uuid)
        Buffers: shared hit=64
Planning Time: 0.031 ms
Execution Time: 0.170 ms

=== chat_id_created_at_id | smallest (36 сообщений) | first | тёплый кэш
Limit  (cost=0.42..94.71 rows=51 width=176) (actual time=0.006..0.010 rows=36 loops=1)
  Buffers: shared hit=5
  ->  Index Scan using messages_history_idx on messages  (cost=0.42..272.19 rows=147 width=176) (actual time=0.006..0.009 rows=36 loops=1)
        Index Cond: (chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid)
        Buffers: shared hit=5
Planning Time: 0.044 ms
Execution Time: 0.016 ms

=== chat_id_created_at_id | smallest (36 сообщений) | keyset_deep | тёплый кэш
Limit  (cost=0.42..35.00 rows=16 width=176) (actual time=0.005..0.006 rows=4 loops=1)
  Buffers: shared hit=4
  ->  Index Scan using messages_history_idx on messages  (cost=0.42..35.00 rows=16 width=176) (actual time=0.005..0.006 rows=4 loops=1)
        Index Cond: ((chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid) AND (ROW(created_at, id) > ROW('2026-01-27 16:00:00+00'::timestamp with time zone, '000003e8-0000-7000-8002-000000000020'::uuid)))
        Buffers: shared hit=4
Planning Time: 0.039 ms
Execution Time: 0.012 ms

=== chat_id_created_at_id | smallest (36 сообщений) | offset_deep | тёплый кэш
Limit  (cost=59.58..153.87 rows=51 width=176) (actual time=0.008..0.009 rows=4 loops=1)
  Buffers: shared hit=5
  ->  Index Scan using messages_history_idx on messages  (cost=0.42..272.19 rows=147 width=176) (actual time=0.005..0.007 rows=36 loops=1)
        Index Cond: (chat_id = '00000000-0000-7000-8000-0000000003e8'::uuid)
        Buffers: shared hit=5
Planning Time: 0.040 ms
Execution Time: 0.015 ms

