Limit  (cost=3112.96..3113.09 rows=50 width=66) (actual time=3.970..3.974 rows=50 loops=1)
  Buffers: shared hit=1248
  ->  Sort  (cost=3112.96..3121.48 rows=3408 width=66) (actual time=3.969..3.971 rows=50 loops=1)
        Sort Key: created_at, id
        Sort Method: top-N heapsort  Memory: 31kB
        Buffers: shared hit=1248
        ->  Seq Scan on messages  (cost=0.00..2999.75 rows=3408 width=66) (actual time=3.147..3.873 rows=1999 loops=1)
              Filter: ((chat_id = '9af8786b-05c3-4793-b29e-a0702fab01fc'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.310001+00'::timestamp with time zone, '50567333-6286-45dd-99db-ccbf6c94925b'::uuid)))
              Rows Removed by Filter: 98101
              Buffers: shared hit=1248
Planning Time: 0.048 ms
Execution Time: 3.986 ms
