explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7CuU

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 5,632.807 ↓ 0.0 0 1

Limit (cost=584,531.96..584,533.18 rows=10 width=240) (actual time=5,632.807..5,632.807 rows=0 loops=1)

2. 80.604 5,706.427 ↓ 0.0 0 1

Gather Merge (cost=584,531.96..597,629.02 rows=107,394 width=240) (actual time=5,632.806..5,706.427 rows=0 loops=1)

  • Workers Planned: 6
  • Workers Launched: 6
3. 0.070 5,625.823 ↓ 0.0 0 7 / 7

Sort (cost=583,531.86..583,576.61 rows=17,899 width=240) (actual time=5,625.823..5,625.823 rows=0 loops=7)

  • Sort Key: webchatuse5_.updated DESC, webchatuse5_.daemon_user_id, message1_.id
  • Sort Method: quicksort Memory: 25kB
  • Worker 0: Sort Method: quicksort Memory: 25kB
  • Worker 1: Sort Method: quicksort Memory: 25kB
  • Worker 2: Sort Method: quicksort Memory: 25kB
  • Worker 3: Sort Method: quicksort Memory: 25kB
  • Worker 4: Sort Method: quicksort Memory: 25kB
  • Worker 5: Sort Method: quicksort Memory: 25kB
4. 0.001 5,625.753 ↓ 0.0 0 7 / 7

Hash Left Join (cost=142,372.02..583,145.07 rows=17,899 width=240) (actual time=5,625.753..5,625.753 rows=0 loops=7)

  • Hash Cond: (message1_.user_id = user6_.id)
5. 0.000 5,625.752 ↓ 0.0 0 7 / 7

Nested Loop (cost=142,319.45..583,045.40 rows=17,899 width=229) (actual time=5,625.752..5,625.752 rows=0 loops=7)

6. 1,019.806 5,625.752 ↓ 0.0 0 7 / 7

Parallel Hash Join (cost=142,319.02..564,975.74 rows=17,899 width=229) (actual time=5,625.751..5,625.752 rows=0 loops=7)

  • Hash Cond: (webchatuse5_.client_id = client4_.id)
7. 4,524.609 4,524.609 ↑ 1.2 2,274,142 7 / 7

Parallel Seq Scan on web_chat_user_data webchatuse5_ (cost=0.00..380,845.68 rows=2,650,868 width=24) (actual time=1.814..4,524.609 rows=2,274,142 loops=7)

8. 1.872 81.337 ↑ 4,765.4 5 7 / 7

Parallel Hash (cost=141,322.18..141,322.18 rows=23,827 width=213) (actual time=81.337..81.337 rows=5 loops=7)

  • Buckets: 4,096 Batches: 16 Memory Usage: 128kB
9. 0.008 79.465 ↑ 4,765.4 5 7 / 7

Nested Loop (cost=1.99..141,322.18 rows=23,827 width=213) (actual time=73.058..79.465 rows=5 loops=7)

10. 0.009 79.330 ↑ 4,765.4 5 7 / 7

Nested Loop (cost=1.56..104,057.90 rows=23,827 width=219) (actual time=73.027..79.330 rows=5 loops=7)

11. 1.693 79.242 ↑ 4,765.4 5 7 / 7

Nested Loop (cost=1.13..67,102.30 rows=23,827 width=213) (actual time=73.006..79.242 rows=5 loops=7)

12. 21.578 21.578 ↑ 3.9 6,219 7 / 7

Parallel Index Scan using message_data_is_sent_idx on msg_messages_data messagedat0_ (cost=0.56..2,081.02 rows=23,958 width=178) (actual time=0.031..21.578 rows=6,219 loops=7)

  • Index Cond: (is_sent = 0)
13. 55.971 55.971 ↓ 0.0 0 43,533 / 7

Index Scan using msg_messages_pkey on msg_messages message1_ (cost=0.56..2.71 rows=1 width=43) (actual time=0.009..0.009 rows=0 loops=43,533)

  • Index Cond: (id = messagedat0_.message_id)
  • Filter: (type >= 0)
  • Rows Removed by Filter: 1
14. 0.079 0.079 ↑ 1.0 1 37 / 7

Index Scan using msg_dialogs_pkey on msg_dialogs dialog2_ (cost=0.43..1.55 rows=1 width=22) (actual time=0.015..0.015 rows=1 loops=37)

  • Index Cond: (id = message1_.dialog_id)
15. 0.127 0.127 ↑ 1.0 1 37 / 7

Index Scan using msg_clients_login_idx on msg_clients client4_ (cost=0.43..1.56 rows=1 width=21) (actual time=0.024..0.024 rows=1 loops=37)

  • Index Cond: ((login)::text = (dialog2_.external_id)::text)
16. 0.000 0.000 ↓ 0.0 0 / 7

Index Only Scan using msg_appeals_pkey on msg_appeals appeal3_ (cost=0.43..1.01 rows=1 width=8) (never executed)

  • Index Cond: (id = message1_.appeal_id)
  • Heap Fetches: 0
17. 0.000 0.000 ↓ 0.0 0 / 7

Hash (cost=40.59..40.59 rows=959 width=19) (never executed)

18. 0.000 0.000 ↓ 0.0 0 / 7

Seq Scan on users user6_ (cost=0.00..40.59 rows=959 width=19) (never executed)

Planning time : 4.372 ms
Execution time : 5,706.546 ms