explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wSnD

Settings
# exclusive inclusive rows x rows loops node
1. 298.743 23,618.774 ↓ 2.3 58,330 1

Sort (cost=4,330,611.45..4,330,674.57 rows=25,248 width=209) (actual time=23,548.172..23,618.774 rows=58,330 loops=1)

  • Sort Key: kudos_i.ts_created DESC, kudos_i.id DESC
  • Sort Method: external merge Disk: 89336kB
2. 235.227 23,320.031 ↓ 2.3 58,330 1

Nested Loop Left Join (cost=25,165.38..4,328,765.33 rows=25,248 width=209) (actual time=130.124..23,320.031 rows=58,330 loops=1)

3. 202.291 12,468.744 ↓ 2.3 58,330 1

Nested Loop Left Join (cost=25,090.15..2,428,057.84 rows=25,248 width=153) (actual time=130.052..12,468.744 rows=58,330 loops=1)

4. 175.491 1,358.743 ↓ 2.3 58,330 1

Nested Loop Left Join (cost=25,014.92..527,855.32 rows=25,248 width=89) (actual time=129.931..1,358.743 rows=58,330 loops=1)

5. 0.000 191.642 ↓ 2.3 58,330 1

Gather (cost=24,998.29..107,286.76 rows=25,248 width=65) (actual time=129.869..191.642 rows=58,330 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 115.825 419.164 ↓ 1.8 19,443 3

Nested Loop Left Join (cost=23,998.29..103,761.96 rows=10,520 width=65) (actual time=126.554..419.164 rows=19,443 loops=3)

7. 91.107 303.336 ↓ 1.8 19,443 3

Parallel Hash Join (cost=23,997.87..98,021.70 rows=10,520 width=57) (actual time=126.509..303.336 rows=19,443 loops=3)

  • Hash Cond: (kudos_period_rel.from_bo_instance_id = kudos_i.id)
8. 89.130 103.083 ↑ 1.3 85,341 3

Parallel Bitmap Heap Scan on boi_rel kudos_period_rel (cost=4,937.62..78,673.39 rows=109,734 width=16) (actual time=16.737..103.083 rows=85,341 loops=3)

  • Recheck Cond: (boc_rel_type_id = 15)
  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=1
9. 13.953 13.953 ↑ 1.0 256,028 1

Bitmap Index Scan on idx_boi_rel_boc_rel_type_id (cost=0.00..4,871.78 rows=263,380 width=0) (actual time=13.953..13.953 rows=256,028 loops=1)

  • Index Cond: (boc_rel_type_id = 15)
10. 52.632 109.146 ↑ 1.3 54,510 3

Parallel Hash (cost=18,185.98..18,185.98 rows=69,942 width=41) (actual time=109.145..109.146 rows=54,510 loops=3)

  • Buckets: 262144 Batches: 1 Memory Usage: 15296kB
11. 56.514 56.514 ↑ 1.3 54,510 3

Parallel Index Scan using idx_bo_instance_tenant_id on bo_instance kudos_i (cost=0.43..18,185.98 rows=69,942 width=41) (actual time=0.026..56.514 rows=54,510 loops=3)

  • Index Cond: (tenant_id = 314)
  • Filter: (NOT is_deleted)
12. 0.003 0.003 ↑ 1.0 1 58,330

Index Scan using idx_attrib_kudos_bo_instance_id on attrib_kudos attr_kudos (cost=0.42..0.54 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=58,330)

  • Index Cond: (bo_instance_id = kudos_i.id)
13. 349.980 991.610 ↑ 1.0 1 58,330

Aggregate (cost=16.63..16.64 rows=1 width=32) (actual time=0.016..0.017 rows=1 loops=58,330)

14. 233.320 641.630 ↑ 1.0 1 58,330

Nested Loop Left Join (cost=0.57..16.62 rows=1 width=204) (actual time=0.008..0.011 rows=1 loops=58,330)

  • Join Filter: (attr_period.bo_instance_id = period_i.id)
15. 233.320 233.320 ↑ 1.0 1 58,330

Index Scan using bo_instance_pkey on bo_instance period_i (cost=0.43..8.45 rows=1 width=167) (actual time=0.003..0.004 rows=1 loops=58,330)

  • Index Cond: (id = kudos_period_rel.to_bo_instance_id)
  • Filter: (NOT is_deleted)
16. 174.990 174.990 ↑ 1.0 1 58,330

Index Scan using idx_attrib_period_bo_instance_id on attrib_period attr_period (cost=0.14..8.16 rows=1 width=45) (actual time=0.002..0.003 rows=1 loops=58,330)

  • Index Cond: (bo_instance_id = kudos_period_rel.to_bo_instance_id)
17. 3,499.800 10,907.710 ↑ 1.0 1 58,330

Aggregate (cost=75.23..75.24 rows=1 width=64) (actual time=0.187..0.187 rows=1 loops=58,330)

18. 1,341.590 7,407.910 ↓ 2.1 15 58,330

Nested Loop Left Join (cost=1.71..75.16 rows=7 width=384) (actual time=0.021..0.127 rows=15 loops=58,330)

19. 174.990 641.630 ↑ 3.0 1 58,330

Nested Loop Left Join (cost=0.86..37.33 rows=3 width=200) (actual time=0.009..0.011 rows=1 loops=58,330)

20. 291.650 291.650 ↑ 3.0 1 58,330

Index Scan using boi_rel_is_deleted_to_bo_instance_id_boc_rel_type_id_idx on boi_rel person_kudos_giver_rel (cost=0.43..12.00 rows=3 width=8) (actual time=0.004..0.005 rows=1 loops=58,330)

  • Index Cond: ((is_deleted = false) AND (to_bo_instance_id = kudos_period_rel.from_bo_instance_id) AND (boc_rel_type_id = 32))
  • Filter: (NOT is_deleted)
21. 174.990 174.990 ↑ 1.0 1 58,330

Index Scan using bo_instance_pkey on bo_instance giver_i (cost=0.43..8.45 rows=1 width=192) (actual time=0.003..0.003 rows=1 loops=58,330)

  • Index Cond: (id = person_kudos_giver_rel.from_bo_instance_id)
  • Filter: (NOT is_deleted)
22. 1,748.199 5,424.690 ↓ 15.0 15 58,330

Nested Loop Left Join (cost=0.86..12.60 rows=1 width=200) (actual time=0.009..0.093 rows=15 loops=58,330)

23. 1,049.940 1,049.940 ↓ 15.0 15 58,330

Index Scan using boi_rel_boc_rel_type_id_from_bo_instance_id_idx on boi_rel giver_team_rel (cost=0.43..8.45 rows=1 width=16) (actual time=0.004..0.018 rows=15 loops=58,330)

  • Index Cond: ((boc_rel_type_id = 31) AND (from_bo_instance_id = person_kudos_giver_rel.from_bo_instance_id))
  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 0
24. 2,626.551 2,626.551 ↑ 1.0 1 875,517

Index Scan using bo_instance_pkey on bo_instance giver_team_i (cost=0.43..4.15 rows=1 width=192) (actual time=0.003..0.003 rows=1 loops=875,517)

  • Index Cond: (id = giver_team_rel.to_bo_instance_id)
  • Filter: (NOT is_deleted)
25. 3,091.490 10,616.060 ↑ 1.0 1 58,330

Aggregate (cost=75.23..75.25 rows=1 width=64) (actual time=0.182..0.182 rows=1 loops=58,330)

26. 1,341.590 7,524.570 ↓ 2.1 15 58,330

Nested Loop Left Join (cost=1.71..75.16 rows=7 width=384) (actual time=0.023..0.129 rows=15 loops=58,330)

27. 233.320 758.290 ↑ 3.0 1 58,330

Nested Loop Left Join (cost=0.86..37.33 rows=3 width=200) (actual time=0.011..0.013 rows=1 loops=58,330)

28. 233.320 233.320 ↑ 3.0 1 58,330

Index Scan using boi_rel_is_deleted_to_bo_instance_id_boc_rel_type_id_idx on boi_rel person_kudos_receiver_rel (cost=0.43..12.00 rows=3 width=8) (actual time=0.004..0.004 rows=1 loops=58,330)

  • Index Cond: ((is_deleted = false) AND (to_bo_instance_id = kudos_period_rel.from_bo_instance_id) AND (boc_rel_type_id = 33))
  • Filter: (NOT is_deleted)
29. 291.650 291.650 ↑ 1.0 1 58,330

Index Scan using bo_instance_pkey on bo_instance receiver_i (cost=0.43..8.45 rows=1 width=192) (actual time=0.005..0.005 rows=1 loops=58,330)

  • Index Cond: (id = person_kudos_receiver_rel.from_bo_instance_id)
  • Filter: (NOT is_deleted)
30. 1,692.470 5,424.690 ↓ 15.0 15 58,330

Nested Loop Left Join (cost=0.86..12.60 rows=1 width=200) (actual time=0.010..0.093 rows=15 loops=58,330)

31. 1,108.270 1,108.270 ↓ 15.0 15 58,330

Index Scan using boi_rel_boc_rel_type_id_from_bo_instance_id_idx on boi_rel receiver_team_rel (cost=0.43..8.45 rows=1 width=16) (actual time=0.005..0.019 rows=15 loops=58,330)

  • Index Cond: ((boc_rel_type_id = 31) AND (from_bo_instance_id = person_kudos_receiver_rel.from_bo_instance_id))
  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 0
32. 2,623.950 2,623.950 ↑ 1.0 1 874,650

Index Scan using bo_instance_pkey on bo_instance receiver_team_i (cost=0.43..4.15 rows=1 width=192) (actual time=0.003..0.003 rows=1 loops=874,650)

  • Index Cond: (id = receiver_team_rel.to_bo_instance_id)
  • Filter: (NOT is_deleted)
Planning time : 2.483 ms
Execution time : 23,671.483 ms