explain.depesz.com

PostgreSQL's explain analyze made readable

Result: M4Bp

Settings
# exclusive inclusive rows x rows loops node
1. 0.095 37,564.225 ↑ 1.0 1 1

Aggregate (cost=536.66..536.67 rows=1 width=8) (actual time=37,564.225..37,564.225 rows=1 loops=1)

2. 1.408 37,564.130 ↓ 38.0 38 1

Nested Loop Left Join (cost=1.70..536.66 rows=1 width=8) (actual time=776.129..37,564.130 rows=38 loops=1)

  • Filter: (mua.id IS NULL)
  • Rows Removed by Filter: 206
3. 2.333 36,128.978 ↓ 1.7 244 1

Nested Loop (cost=1.28..463.68 rows=143 width=16) (actual time=66.540..36,128.978 rows=244 loops=1)

  • Join Filter: (mcm.userid <> m.useridfrom)
  • Rows Removed by Join Filter: 240
4. 2.258 23,305.837 ↓ 11.0 308 1

Nested Loop (cost=0.85..347.88 rows=28 width=24) (actual time=26.645..23,305.837 rows=308 loops=1)

5. 9,635.771 9,635.771 ↓ 11.0 308 1

Index Scan using mdl_messconvmemb_use_ix on mdl_message_conversation_members mcm (cost=0.42..111.49 rows=28 width=16) (actual time=26.617..9,635.771 rows=308 loops=1)

  • Index Cond: (userid = 22)
6. 13,667.808 13,667.808 ↑ 1.0 1 308

Index Scan using mdl_messconv_id_pk on mdl_message_conversations mc (cost=0.42..8.44 rows=1 width=8) (actual time=44.376..44.376 rows=1 loops=308)

  • Index Cond: (id = mcm.conversationid)
  • Filter: (enabled = 1)
7. 12,820.808 12,820.808 ↑ 15.0 2 308

Index Scan using mdl_mess_con_ix on mdl_messages m (cost=0.43..3.76 rows=30 width=24) (actual time=31.095..41.626 rows=2 loops=308)

  • Index Cond: (conversationid = mc.id)
8. 1,433.744 1,433.744 ↑ 1.0 1 244

Index Scan using mdl_messuseracti_usemesact_uix on mdl_message_user_actions mua (cost=0.43..0.50 rows=1 width=16) (actual time=5.876..5.876 rows=1 loops=244)

  • Index Cond: ((userid = 22) AND (messageid = m.id) AND (action = 1))