Dataset: at least 10,000 synthetic messages across 100 chats.
Query: history ordered by (created_at, id), LIMIT 51.

Limit  (cost=143.99..144.12 rows=51 width=79) (actual time=0.561..0.567 rows=51 loops=1)
  Buffers: shared hit=109
  ->  Sort  (cost=143.99..144.24 rows=100 width=79) (actual time=0.560..0.563 rows=51 loops=1)
        Sort Key: created_at, id
        Sort Method: quicksort  Memory: 38kB
        Buffers: shared hit=109
        ->  Bitmap Heap Scan on messages  (cost=9.06..140.67 rows=100 width=79) (actual time=0.150..0.335 rows=100 loops=1)
              Recheck Cond: (chat_id = 'fb9f060e-91d3-4ee8-a3f3-adf6ffe42ba0'::uuid)
              Heap Blocks: exact=100
              Buffers: shared hit=103
              ->  Bitmap Index Scan on messages_chat_created_id_idx  (cost=0.00..9.04 rows=100 width=0) (actual time=0.128..0.129 rows=100 loops=1)
                    Index Cond: (chat_id = 'fb9f060e-91d3-4ee8-a3f3-adf6ffe42ba0'::uuid)
                    Buffers: shared hit=3
Planning:
  Buffers: shared hit=107
Planning Time: 0.974 ms
Execution Time: 0.696 ms
