explain.depesz.com

PostgreSQL's explain analyze made readable

Result: b67N

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 0.047 ↑ 1.0 1 1

Aggregate (cost=1,343.35..1,343.36 rows=1 width=8) (actual time=0.047..0.047 rows=1 loops=1)

2. 0.007 0.046 ↑ 1.0 1 1

Hash Join (cost=60.60..1,343.35 rows=1 width=0) (actual time=0.044..0.046 rows=1 loops=1)

  • Hash Cond: (conversations.last_message_id = last_message.id)
3. 0.002 0.026 ↑ 191.0 1 1

Nested Loop (cost=1.00..1,283.25 rows=191 width=4) (actual time=0.026..0.026 rows=1 loops=1)

4. 0.014 0.014 ↑ 403.0 1 1

Index Scan using index_conversation_users_on_user_id on conversation_users (cost=0.56..212.37 rows=403 width=4) (actual time=0.014..0.014 rows=1 loops=1)

  • Index Cond: (user_id = 2,010)
5. 0.010 0.010 ↑ 1.0 1 1

Index Scan using idx_chats_id_hiddenby on conversations (cost=0.44..2.66 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: (id = conversation_users.conversation_id)
  • Filter: ((hidden_by <> 1) AND (hidden_by <> 3))
6. 0.002 0.013 ↑ 85.0 1 1

Hash (cost=58.53..58.53 rows=85 width=4) (actual time=0.013..0.013 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
7. 0.011 0.011 ↑ 85.0 1 1

Index Scan using index_messages_on_recipient_id_unread on messages last_message (cost=0.43..58.53 rows=85 width=4) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: (recipient_id = 2,010)
  • Filter: ((NOT deleted_by_sender) AND (NOT deleted_by_recipient))
Planning time : 0.486 ms
Execution time : 0.089 ms