explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DkEA

Settings
# exclusive inclusive rows x rows loops node
1. 0.022 379.704 ↓ 1.3 4 1

Sort (cost=35,553.77..35,553.78 rows=3 width=77) (actual time=379.703..379.704 rows=4 loops=1)

  • Sort Key: activity_activityissue.id
  • Sort Method: quicksort Memory: 25kB
2. 11.022 379.682 ↓ 1.3 4 1

Hash Join (cost=32,842.90..35,553.75 rows=3 width=77) (actual time=347.319..379.682 rows=4 loops=1)

  • Hash Cond: (activity_activityissue_1.id = activity_activityissue.id)
3. 78.854 368.583 ↓ 1.3 157,875 1

HashAggregate (cost=32,820.36..34,018.52 rows=119,816 width=4) (actual time=339.069..368.583 rows=157,875 loops=1)

  • Group Key: activity_activityissue_1.id
4. 7.854 289.729 ↓ 1.3 157,875 1

Append (cost=6.00..32,520.82 rows=119,816 width=4) (actual time=139.425..289.729 rows=157,875 loops=1)

5. 0.001 0.034 ↓ 0.0 0 1

Nested Loop (cost=6.00..1,734.36 rows=1,410 width=4) (actual time=0.034..0.034 rows=0 loops=1)

6. 0.000 0.033 ↓ 0.0 0 1

Nested Loop (cost=5.58..616.79 rows=2,161 width=4) (actual time=0.033..0.033 rows=0 loops=1)

7. 0.000 0.033 ↓ 0.0 0 1

Nested Loop (cost=5.17..12.94 rows=6 width=4) (actual time=0.033..0.033 rows=0 loops=1)

8. 0.000 0.033 ↓ 0.0 0 1

Nested Loop (cost=4.89..11.72 rows=1 width=8) (actual time=0.033..0.033 rows=0 loops=1)

9. 0.001 0.033 ↓ 0.0 0 1

Nested Loop (cost=4.62..10.91 rows=1 width=16) (actual time=0.032..0.033 rows=0 loops=1)

10. 0.004 0.032 ↓ 0.0 0 1

Hash Join (cost=4.49..10.56 rows=1 width=12) (actual time=0.032..0.032 rows=0 loops=1)

  • Hash Cond: (customer_contract.id = customer_contract_users.contract_id)
11. 0.009 0.009 ↑ 84.0 1 1

Seq Scan on customer_contract (cost=0.00..5.84 rows=84 width=8) (actual time=0.009..0.009 rows=1 loops=1)

12. 0.000 0.019 ↓ 0.0 0 1

Hash (cost=4.47..4.47 rows=1 width=4) (actual time=0.019..0.019 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
13. 0.019 0.019 ↓ 0.0 0 1

Seq Scan on customer_contract_users (cost=0.00..4.47 rows=1 width=4) (actual time=0.019..0.019 rows=0 loops=1)

  • Filter: (user_id = 71)
  • Rows Removed by Filter: 198
14. 0.000 0.000 ↓ 0.0 0

Index Only Scan using customer_entity_pkey on customer_entity (cost=0.13..0.29 rows=1 width=4) (never executed)

  • Index Cond: (id = customer_contract.entity_id)
  • Heap Fetches: 0
15. 0.000 0.000 ↓ 0.0 0

Index Only Scan using customer_entity_users_entity_id_user_id_cdc6b5d7_uniq on customer_entity_users (cost=0.27..0.63 rows=1 width=4) (never executed)

  • Index Cond: ((entity_id = customer_contract.entity_id) AND (user_id = 71))
  • Heap Fetches: 0
16. 0.000 0.000 ↓ 0.0 0

Index Scan using activity_allocation_contract_id_7af29382 on activity_allocation (cost=0.28..1.10 rows=12 width=8) (never executed)

  • Index Cond: (contract_id = customer_contract.id)
17. 0.000 0.000 ↓ 0.0 0

Index Scan using activity_activity_allocation_id_40844e21 on activity_activity (cost=0.42..96.83 rows=381 width=8) (never executed)

  • Index Cond: (allocation_id = activity_allocation.id)
18. 0.000 0.000 ↓ 0.0 0

Index Scan using activity_activityissue_activity_id_f9cf6515 on activity_activityissue activity_activityissue_1 (cost=0.42..0.50 rows=2 width=8) (never executed)

  • Index Cond: (activity_id = activity_activity.id)
19. 30.346 281.841 ↓ 1.3 157,875 1

Hash Join (cost=21,524.59..29,588.30 rows=118,406 width=4) (actual time=139.389..281.841 rows=157,875 loops=1)

  • Hash Cond: (activity_activity_1.allocation_id = activity_allocation_1.id)
20. 82.826 251.095 ↑ 1.0 157,875 1

Hash Join (cost=21,478.28..27,766.47 rows=157,875 width=8) (actual time=138.986..251.095 rows=157,875 loops=1)

  • Hash Cond: (activity_activityissue_2.activity_id = activity_activity_1.id)
21. 29.361 29.361 ↑ 1.0 157,875 1

Seq Scan on activity_activityissue activity_activityissue_2 (cost=0.00..3,693.75 rows=157,875 width=8) (actual time=0.009..29.361 rows=157,875 loops=1)

22. 50.165 138.908 ↑ 1.0 242,057 1

Hash (cost=17,506.57..17,506.57 rows=242,057 width=8) (actual time=138.908..138.908 rows=242,057 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 3402kB
23. 88.743 88.743 ↑ 1.0 242,057 1

Seq Scan on activity_activity activity_activity_1 (cost=0.00..17,506.57 rows=242,057 width=8) (actual time=0.009..88.743 rows=242,057 loops=1)

24. 0.071 0.400 ↓ 1.3 691 1

Hash (cost=39.83..39.83 rows=518 width=4) (actual time=0.400..0.400 rows=691 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 33kB
25. 0.145 0.329 ↓ 1.3 691 1

Hash Join (cost=16.15..39.83 rows=518 width=4) (actual time=0.118..0.329 rows=691 loops=1)

  • Hash Cond: (activity_allocation_1.contract_id = customer_contract_1.id)
26. 0.076 0.076 ↑ 1.0 691 1

Seq Scan on activity_allocation activity_allocation_1 (cost=0.00..15.91 rows=691 width=8) (actual time=0.006..0.076 rows=691 loops=1)

27. 0.010 0.108 ↓ 1.3 84 1

Hash (cost=15.37..15.37 rows=63 width=4) (actual time=0.108..0.108 rows=84 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
28. 0.030 0.098 ↓ 1.3 84 1

Hash Join (cost=8.58..15.37 rows=63 width=4) (actual time=0.046..0.098 rows=84 loops=1)

  • Hash Cond: (customer_contract_1.entity_id = customer_entity_1.id)
29. 0.028 0.028 ↑ 1.0 84 1

Seq Scan on customer_contract customer_contract_1 (cost=0.00..5.84 rows=84 width=8) (actual time=0.002..0.028 rows=84 loops=1)

30. 0.001 0.040 ↑ 1.0 3 1

Hash (cost=8.54..8.54 rows=3 width=8) (actual time=0.040..0.040 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
31. 0.005 0.039 ↑ 1.0 3 1

Hash Join (cost=5.39..8.54 rows=3 width=8) (actual time=0.036..0.039 rows=3 loops=1)

  • Hash Cond: (customer_entity_users_1.entity_id = customer_entity_1.id)
32. 0.006 0.023 ↑ 1.0 3 1

Bitmap Heap Scan on customer_entity_users customer_entity_users_1 (cost=4.30..7.43 rows=3 width=4) (actual time=0.021..0.023 rows=3 loops=1)

  • Recheck Cond: (user_id = 71)
  • Heap Blocks: exact=2
33. 0.017 0.017 ↑ 1.0 3 1

Bitmap Index Scan on customer_entity_users_user_id_538fc651 (cost=0.00..4.29 rows=3 width=0) (actual time=0.017..0.017 rows=3 loops=1)

  • Index Cond: (user_id = 71)
34. 0.003 0.011 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=4) (actual time=0.010..0.011 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
35. 0.008 0.008 ↑ 1.0 4 1

Seq Scan on customer_entity customer_entity_1 (cost=0.00..1.04 rows=4 width=4) (actual time=0.008..0.008 rows=4 loops=1)

36. 0.005 0.077 ↑ 1.0 4 1

Hash (cost=22.49..22.49 rows=4 width=77) (actual time=0.077..0.077 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
37. 0.072 0.072 ↑ 1.0 4 1

Index Scan using activity_activityissue_pkey on activity_activityissue (cost=0.42..22.49 rows=4 width=77) (actual time=0.059..0.072 rows=4 loops=1)

  • Index Cond: (id = ANY ('{2769340,2769341,2769342,2769343}'::integer[]))