Limit  (cost=0.29..5.12 rows=50 width=24) (actual time=0.009..0.018 rows=50 loops=1)
  Buffers: shared hit=5
  ->  Index Only Scan using messages_history_idx on messages  (cost=0.29..484.01 rows=5004 width=24) (actual time=0.009..0.016 rows=50 loops=1)
        Index Cond: ((chat_id = '04dcff1d-2954-4718-bbcb-34e28670812a'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 03:00:05+03'::timestamp with time zone, 'd83da0d1-8e48-405c-a04f-e77621eec78f'::uuid)))
        Heap Fetches: 50
        Buffers: shared hit=5
Planning:
  Buffers: shared hit=33
Planning Time: 0.157 ms
Execution Time: 0.035 ms
