explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Avan : Optimization for: plan #YKm6

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 13.449 81.757 ↑ 1,239.0 1 1

Gather (cost=4,019.45..8,166.51 rows=1,239 width=217) (actual time=54.997..81.757 rows=1 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
2. 0.527 68.308 ↓ 0.0 0 2

Hash Join (cost=3,019.45..7,042.61 rows=729 width=217) (actual time=56.641..68.308 rows=0 loops=2)

  • Hash Cond: (root_commenter.companyid = company.id)
3. 0.018 66.294 ↓ 0.0 0 2

Hash Join (cost=2,976.57..6,997.81 rows=729 width=213) (actual time=54.629..66.294 rows=0 loops=2)

  • Hash Cond: (root.commenteruserid = root_commenter.id)
4. 0.033 65.426 ↓ 0.0 0 2

Hash Join (cost=2,938.81..6,958.13 rows=729 width=192) (actual time=53.761..65.426 rows=0 loops=2)

  • Hash Cond: (comment.commenteruserid = appuser.id)
5. 2.682 64.561 ↓ 0.0 0 2

Nested Loop (cost=2,901.06..6,918.45 rows=729 width=156) (actual time=52.896..64.561 rows=0 loops=2)

6. 2.996 61.876 ↑ 1.3 578 2

Nested Loop (cost=2,900.77..5,286.79 rows=758 width=136) (actual time=51.911..61.876 rows=578 loops=2)

  • Join Filter: (comment.call_id = callrecording.callid)
7. 0.998 58.877 ↑ 1.7 578 2

Hash Join (cost=2,900.48..4,600.25 rows=996 width=136) (actual time=51.893..58.877 rows=578 loops=2)

  • Hash Cond: (comment.call_id = call.id)
8. 6.144 6.144 ↑ 3.6 583 2

Parallel Seq Scan on comment (cost=0.00..1,694.32 rows=2,080 width=128) (actual time=0.015..6.144 rows=583 loops=2)

  • Filter: ((reply_notification_email_sent_date_time IS NULL) AND (NOT deleted) AND (comment_type = 'REPLY'::comment_type))
  • Rows Removed by Filter: 19500
9. 19.071 51.735 ↑ 1.0 25,766 2

Hash (cost=2,577.03..2,577.03 rows=25,876 width=8) (actual time=51.734..51.735 rows=25,766 loops=2)

  • Buckets: 32768 Batches: 1 Memory Usage: 1263kB
10. 32.664 32.664 ↑ 1.0 25,766 2

Seq Scan on call (cost=0.00..2,577.03 rows=25,876 width=8) (actual time=0.026..32.664 rows=25,766 loops=2)

  • Filter: (status = 'COMPLETED'::callstatus)
  • Rows Removed by Filter: 28237
11. 0.003 0.003 ↑ 1.0 1 1,156

Index Scan using callrecording_bycall on callrecording (cost=0.29..0.68 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=1,156)

  • Index Cond: (callid = call.id)
12. 0.003 0.003 ↓ 0.0 0 1,156

Index Scan using comment_pkey on comment root (cost=0.29..2.14 rows=1 width=28) (actual time=0.003..0.003 rows=0 loops=1,156)

  • Index Cond: (id = comment.reply_to_comment_id)
  • Filter: (comment.commenteruserid <> commenteruserid)
  • Rows Removed by Filter: 1
13. 0.418 0.832 ↑ 1.0 567 2

Hash (cost=30.67..30.67 rows=567 width=44) (actual time=0.832..0.832 rows=567 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 53kB
14. 0.414 0.414 ↑ 1.0 567 2

Seq Scan on appuser (cost=0.00..30.67 rows=567 width=44) (actual time=0.008..0.414 rows=567 loops=2)

15. 0.379 0.850 ↑ 1.0 567 2

Hash (cost=30.67..30.67 rows=567 width=29) (actual time=0.850..0.850 rows=567 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 45kB
16. 0.471 0.471 ↑ 1.0 567 2

Seq Scan on appuser root_commenter (cost=0.00..30.67 rows=567 width=29) (actual time=0.024..0.471 rows=567 loops=2)

17. 0.759 1.487 ↑ 1.0 1,150 2

Hash (cost=28.50..28.50 rows=1,150 width=20) (actual time=1.486..1.487 rows=1,150 loops=2)

  • Buckets: 2048 Batches: 1 Memory Usage: 75kB
18. 0.728 0.728 ↑ 1.0 1,150 2

Seq Scan on company (cost=0.00..28.50 rows=1,150 width=20) (actual time=0.018..0.728 rows=1,150 loops=2)

Planning time : 6.494 ms
Execution time : 81.975 ms