QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------- Limit (cost=0.29..4.20 rows=50 width=73) (actual time=0.022..0.030 rows=50 loops=1) Buffers: shared hit=3 -> Index Scan using ix_messages_chat_created_id on messages (cost=0.29..782.85 rows=10000 width=73) (actual time=0.021..0.026 rows=50 loops=1) Index Cond: (chat_id = '5f29cf73-9fcf-4103-be1f-0218179ca178'::uuid) Buffers: shared hit=3 Planning: Buffers: shared hit=120 Planning Time: 1.807 ms Execution Time: 0.185 ms (9 rows)