explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cJ6b

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 6.077 ↓ 0.0 0 1

Sort (cost=28.94..28.94 rows=2 width=236) (actual time=6.076..6.077 rows=0 loops=1)

  • Sort Key: webchatuse4_.updated DESC, webchatuse4_.daemon_user_id, message1_.id
  • Sort Method: quicksort Memory: 25kB
2. 0.067 6.069 ↓ 0.0 0 1

Nested Loop (cost=2.84..28.93 rows=2 width=236) (actual time=6.069..6.069 rows=0 loops=1)

3. 0.092 5.627 ↓ 125.0 125 1

Nested Loop Left Join (cost=2.40..10.88 rows=1 width=220) (actual time=2.628..5.627 rows=125 loops=1)

4. 0.029 5.535 ↓ 125.0 125 1

Nested Loop (cost=2.13..8.90 rows=1 width=209) (actual time=2.624..5.535 rows=125 loops=1)

5. 0.023 3.881 ↓ 125.0 125 1

Nested Loop (cost=1.57..6.62 rows=1 width=212) (actual time=2.602..3.881 rows=125 loops=1)

6. 0.175 3.358 ↓ 125.0 125 1

Nested Loop (cost=1.14..4.47 rows=1 width=209) (actual time=2.592..3.358 rows=125 loops=1)

7. 2.683 2.683 ↓ 125.0 125 1

Index Scan using messages_data_index_is_sent on msg_messages_data messagedat0_ (cost=0.57..1.69 rows=1 width=183) (actual time=2.570..2.683 rows=125 loops=1)

  • Index Cond: (is_sent = 0)
8. 0.500 0.500 ↑ 1.0 1 125

Index Scan using msg_messages_id_index on msg_messages message1_ (cost=0.57..2.79 rows=1 width=34) (actual time=0.004..0.004 rows=1 loops=125)

  • Index Cond: (id = messagedat0_.message_id)
  • Filter: (type >= 0)
9. 0.500 0.500 ↑ 1.0 1 125

Index Scan using msg_dialogs_pkey on msg_dialogs dialog2_ (cost=0.43..2.15 rows=1 width=19) (actual time=0.004..0.004 rows=1 loops=125)

  • Index Cond: (id = message1_.dialog_id)
10. 1.625 1.625 ↑ 1.0 1 125

Index Scan using uk_eqoyqk92sghx39f5bmwcd5f08v2 on msg_clients client3_ (cost=0.56..2.28 rows=1 width=21) (actual time=0.013..0.013 rows=1 loops=125)

  • Index Cond: ((login)::text = (dialog2_.external_id)::text)
11. 0.000 0.000 ↓ 0.0 0 125

Index Scan using users_pkey on users user5_ (cost=0.28..1.97 rows=1 width=19) (actual time=0.000..0.000 rows=0 loops=125)

  • Index Cond: (message1_.user_id = id)
12. 0.375 0.375 ↓ 0.0 0 125

Index Scan using web_chat_user_data_client_id_idx on web_chat_user_data webchatuse4_ (cost=0.44..17.77 rows=28 width=24) (actual time=0.003..0.003 rows=0 loops=125)

  • Index Cond: (client_id = client3_.id)
Planning time : 2.055 ms
Execution time : 6.189 ms