Limit  (cost=12317.65..12323.60 rows=51 width=269) (actual time=18.151..22.092 rows=51 loops=1)
  Buffers: shared hit=9184
  ->  Gather Merge  (cost=12317.65..15225.19 rows=24920 width=269) (actual time=18.150..22.087 rows=51 loops=1)
        Workers Planned: 2
        Workers Launched: 2
        Buffers: shared hit=9184
        ->  Sort  (cost=11317.63..11348.78 rows=12460 width=269) (actual time=15.433..15.437 rows=39 loops=3)
              Sort Key: created_at, id
              Sort Method: top-N heapsort  Memory: 57kB
              Buffers: shared hit=9184
              Worker 0:  Sort Method: top-N heapsort  Memory: 64kB
              Worker 1:  Sort Method: top-N heapsort  Memory: 64kB
              ->  Parallel Seq Scan on messages  (cost=0.00..10901.94 rows=12460 width=269) (actual time=0.013..13.836 rows=10000 loops=3)
                    Filter: ((chat_id = '43815b30-3214-43ab-907b-8302428adf62'::uuid) AND (ROW(created_at, id) > ROW('2026-09-14 15:04:07.432+00'::timestamp with time zone, 'b4df760e-4412-48fc-90cc-814d6b6c9617'::uuid)))
                    Rows Removed by Filter: 69906
                    Buffers: shared hit=9154
Planning:
  Buffers: shared hit=121
Planning Time: 1.035 ms
Execution Time: 22.224 ms
