explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8IDB

Settings
# exclusive inclusive rows x rows loops node
1. 133.549 1,194.559 ↓ 0.0 0 1

Gather Merge (cost=414,448.31..415,074.66 rows=5,136 width=207) (actual time=1,081.355..1,194.559 rows=0 loops=1)

  • Workers Planned: 6
  • Workers Launched: 4
2. 0.049 1,061.010 ↓ 0.0 0 5 / 5

Sort (cost=413,448.21..413,450.35 rows=856 width=207) (actual time=1,061.010..1,061.010 rows=0 loops=5)

  • Sort Key: webchatuse4_.updated DESC, webchatuse4_.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
3. 0.001 1,060.961 ↓ 0.0 0 5 / 5

Hash Left Join (cost=8,598.79..413,406.52 rows=856 width=207) (actual time=1,060.961..1,060.961 rows=0 loops=5)

  • Hash Cond: (message1_.user_id = user5_.id)
4. 509.026 1,060.960 ↓ 0.0 0 5 / 5

Parallel Hash Join (cost=7,952.57..412,758.05 rows=856 width=196) (actual time=1,060.960..1,060.960 rows=0 loops=5)

  • Hash Cond: (webchatuse4_.client_id = client3_.id)
5. 541.469 541.469 ↓ 1.2 3,031,623 5 / 5

Parallel Seq Scan on web_chat_user_data webchatuse4_ (cost=0.00..395,307.51 rows=2,531,451 width=16) (actual time=0.014..541.469 rows=3,031,623 loops=5)

6. 0.032 10.465 ↑ 1,152.0 1 5 / 5

Parallel Hash (cost=7,938.17..7,938.17 rows=1,152 width=184) (actual time=10.465..10.465 rows=1 loops=5)

  • Buckets: 2,048 Batches: 1 Memory Usage: 112kB
7. 0.002 10.433 ↑ 1,152.0 1 4 / 5

Nested Loop (cost=24.95..7,938.17 rows=1,152 width=184) (actual time=12.577..13.041 rows=1 loops=4)

8. 0.002 10.393 ↑ 1,152.0 1 4 / 5

Nested Loop (cost=24.52..6,647.71 rows=1,152 width=194) (actual time=12.534..12.991 rows=1 loops=4)

9. 0.009 10.346 ↑ 1,152.0 1 4 / 5

Nested Loop (cost=24.09..5,412.02 rows=1,152 width=184) (actual time=12.487..12.933 rows=1 loops=4)

10. 4.660 9.926 ↑ 31.3 37 4 / 5

Parallel Bitmap Heap Scan on msg_messages_data messagedat0_ (cost=23.52..2,196.04 rows=1,158 width=170) (actual time=12.077..12.407 rows=37 loops=4)

  • Recheck Cond: (is_sent = 0)
  • Heap Blocks: exact=127
11. 5.265 5.265 ↑ 3.0 652 1 / 5

Bitmap Index Scan on message_data_is_sent_idx (cost=0.00..23.03 rows=1,969 width=0) (actual time=26.326..26.326 rows=652 loops=1)

  • Index Cond: (is_sent = 0)
12. 0.412 0.412 ↓ 0.0 0 147 / 5

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

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

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

  • Index Cond: (id = message1_.dialog_id)
14. 0.038 0.038 ↑ 1.0 1 5 / 5

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

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

Hash (cost=626.10..626.10 rows=1,610 width=15) (never executed)

16. 0.000 0.000 ↓ 0.0 0 / 5

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

Planning time : 1.808 ms
Execution time : 1,194.688 ms