                                                                  QUERY PLAN                                                                   
-----------------------------------------------------------------------------------------------------------------------------------------------
 Limit  (cost=0.42..12.63 rows=51 width=64) (actual time=0.011..0.026 rows=51 loops=1)
   Buffers: shared hit=5
   ->  Index Scan using messages_history_idx on messages  (cost=0.42..16699.34 rows=69722 width=64) (actual time=0.010..0.023 rows=51 loops=1)
         Index Cond: (chat_id = '136ef7de-de6a-40ec-b0dc-95d805396a72'::uuid)
         Buffers: shared hit=5
 Planning:
   Buffers: shared hit=137
 Planning Time: 0.293 ms
 Execution Time: 0.041 ms
(9 rows)

