PostgreSQL 16.15 (Ubuntu 16.15-0ubuntu0.24.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0, 64-bit
Fixture messages: 10000
FIRST PAGE: LIMIT 51 (50 items + lookahead)
Limit  (cost=0.29..5.65 rows=51 width=76) (actual time=0.006..0.012 rows=51 loops=1)
  Buffers: shared hit=3
  ->  Index Scan using messages_history_idx on messages  (cost=0.29..1052.02 rows=10000 width=76) (actual time=0.005..0.009 rows=51 loops=1)
        Index Cond: (chat_id = '799a61aa-3fa2-4535-84e9-28889941c357'::uuid)
        Buffers: shared hit=3
Planning:
  Buffers: shared hit=18
Planning Time: 0.046 ms
Execution Time: 0.018 ms
LATER PAGE: after message 9000, LIMIT 51
Limit  (cost=0.29..17.73 rows=51 width=76) (actual time=0.004..0.012 rows=51 loops=1)
  Buffers: shared hit=4
  ->  Index Scan using messages_history_idx on messages  (cost=0.29..375.19 rows=1096 width=76) (actual time=0.003..0.008 rows=51 loops=1)
        Index Cond: ((chat_id = '799a61aa-3fa2-4535-84e9-28889941c357'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.009+00'::timestamp with time zone, 'a598e58f-565a-4ff7-b30b-19dcc8524574'::uuid)))
        Buffers: shared hit=4
Planning Time: 0.035 ms
Execution Time: 0.024 ms
PASS: 10000 messages; first/later pages use messages_history_idx; fixtures rolled back
