explain.depesz.com

PostgreSQL's explain analyze made readable

Result: l7zn

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

Limit (cost=552,141.73..552,142.95 rows=10 width=240) (actual time=5,271.381..5,271.381 rows=0 loops=1)

2. 16.131 5,281.052 ↓ 0.0 0 1

Gather Merge (cost=552,141.73..565,256.36 rows=107,538 width=240) (actual time=5,271.379..5,281.052 rows=0 loops=1)

  • Workers Planned: 6
  • Workers Launched: 4
3. 0.065 5,264.921 ↓ 0.0 0 5 / 5

Sort (cost=551,141.64..551,186.44 rows=17,923 width=240) (actual time=5,264.921..5,264.921 rows=0 loops=5)

  • 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
4. 0.001 5,264.856 ↓ 0.0 0 5 / 5

Hash Left Join (cost=141,673.02..550,754.33 rows=17,923 width=240) (actual time=5,264.856..5,264.856 rows=0 loops=5)

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

Nested Loop (cost=141,620.45..550,654.60 rows=17,923 width=229) (actual time=5,264.855..5,264.855 rows=0 loops=5)

6. 409.733 5,264.855 ↓ 0.0 0 5 / 5

Parallel Hash Join (cost=141,620.02..532,560.71 rows=17,923 width=229) (actual time=5,264.854..5,264.855 rows=0 loops=5)

  • Hash Cond: (webchatuse5_.client_id = client4_.id)
7. 4,764.507 4,764.507 ↓ 1.2 3,183,799 5 / 5

Parallel Seq Scan on web_chat_user_data webchatuse5_ (cost=0.00..380,881.19 rows=2,654,419 width=24) (actual time=0.022..4,764.507 rows=3,183,799 loops=5)

8. 1.185 90.615 ↑ 3,403.9 7 5 / 5

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

  • Buckets: 65,536 Batches: 1 Memory Usage: 576kB
9. 0.012 89.430 ↑ 3,403.9 7 5 / 5

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

10. 0.010 89.322 ↑ 3,403.9 7 5 / 5

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

11. 4.904 89.268 ↑ 3,403.9 7 5 / 5

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

12. 23.418 23.418 ↑ 2.8 8,707 5 / 5

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..23.418 rows=8,707 loops=5)

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

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

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

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

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

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

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

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 / 5

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

18. 0.000 0.000 ↓ 0.0 0 / 5

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

Planning time : 4.343 ms
Execution time : 5,281.175 ms