explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xFPA

Settings
# exclusive inclusive rows x rows loops node
1. 0.008 2,458.932 ↓ 0.0 0 1

Sort (cost=140,494.86..140,494.87 rows=3 width=205) (actual time=2,458.932..2,458.932 rows=0 loops=1)

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

Nested Loop Left Join (cost=2.43..140,494.84 rows=3 width=205) (actual time=2,458.924..2,458.924 rows=0 loops=1)

  • Join Filter: (message1_.user_id = user5_.id)
3. 0.014 2,458.924 ↓ 0.0 0 1

Nested Loop (cost=2.43..139,793.47 rows=3 width=194) (actual time=2,458.924..2,458.924 rows=0 loops=1)

4. 0.019 28.545 ↓ 5.0 5 1

Nested Loop (cost=1.99..6.66 rows=1 width=182) (actual time=0.801..28.545 rows=5 loops=1)

5. 0.019 28.426 ↓ 5.0 5 1

Nested Loop (cost=1.56..5.54 rows=1 width=192) (actual time=0.781..28.426 rows=5 loops=1)

6. 0.020 28.282 ↓ 5.0 5 1

Nested Loop (cost=1.13..4.47 rows=1 width=182) (actual time=0.763..28.282 rows=5 loops=1)

7. 27.380 27.380 ↓ 147.0 147 1

Index Scan using message_data_is_sent_idx on msg_messages_data messagedat0_ (cost=0.56..1.68 rows=1 width=168) (actual time=0.197..27.380 rows=147 loops=1)

  • Index Cond: (is_sent = 0)
8. 0.882 0.882 ↓ 0.0 0 147

Index Scan using msg_messages_pkey on msg_messages message1_ (cost=0.56..2.79 rows=1 width=18) (actual time=0.006..0.006 rows=0 loops=147)

  • Index Cond: (id = messagedat0_.message_id)
  • Filter: (type >= 0)
  • Rows Removed by Filter: 1
9. 0.125 0.125 ↑ 1.0 1 5

Index Scan using msg_dialogs_pkey on msg_dialogs dialog2_ (cost=0.43..1.07 rows=1 width=18) (actual time=0.025..0.025 rows=1 loops=5)

  • Index Cond: (id = message1_.dialog_id)
10. 0.100 0.100 ↑ 1.0 1 5

Index Scan using msg_clients_login_idx on msg_clients client3_ (cost=0.43..1.12 rows=1 width=17) (actual time=0.020..0.020 rows=1 loops=5)

  • Index Cond: ((login)::text = (dialog2_.external_id)::text)
11. 2,430.365 2,430.365 ↓ 0.0 0 5

Index Scan using web_chat_user_data_online_client_id_idx1 on web_chat_user_data webchatuse4_ (cost=0.43..139,786.48 rows=33 width=16) (actual time=486.073..486.073 rows=0 loops=5)

  • Index Cond: (client_id = client3_.id)
12. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..633.84 rows=1,589 width=15) (never executed)

13. 0.000 0.000 ↓ 0.0 0

Seq Scan on users user5_ (cost=0.00..625.89 rows=1,589 width=15) (never executed)

Planning time : 2.922 ms
Execution time : 2,459.029 ms