QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=0.29..4.41 rows=51 width=82) (actual time=0.010..0.017 rows=51 loops=1) Buffers: shared hit=3 -> Index Scan using idx_messages_chat_created_id on messages (cost=0.29..810.06 rows=10000 width=82) (actual time=0.010..0.013 rows=51 loops=1) Index Cond: (chat_id = '96feacdf-3eb6-4e56-9240-bdcd0756ed45'::uuid) Buffers: shared hit=3 Planning: Buffers: shared hit=119 Planning Time: 0.337 ms Execution Time: 0.031 ms (9 rows)