explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 80X94

Settings
# exclusive inclusive rows x rows loops node
1. 0.197 21,515.409 ↓ 25.0 100 1

Limit (cost=3,342.55..3,342.97 rows=4 width=273) (actual time=21,240.899..21,515.409 rows=100 loops=1)

2. 246.202 21,515.212 ↓ 25.0 100 1

GroupAggregate (cost=3,342.55..3,342.97 rows=4 width=273) (actual time=21,240.896..21,515.212 rows=100 loops=1)

  • Group Key: i.id, attr.kudos_remaining
3. 2,852.979 21,269.010 ↓ 5,832.5 23,330 1

Sort (cost=3,342.55..3,342.56 rows=4 width=1,405) (actual time=21,240.494..21,269.010 rows=23,330 loops=1)

  • Sort Key: i.id, attr.kudos_remaining
  • Sort Method: external merge Disk: 995712kB
4. 3,456.560 18,416.031 ↓ 199,075.0 796,300 1

Nested Loop Left Join (cost=6.99..3,342.51 rows=4 width=1,405) (actual time=0.186..18,416.031 rows=796,300 loops=1)

  • Filter: ((i.search_text ~~* '%%'::text) OR (period_i.search_text ~~* '%%'::text) OR (from_person_i.search_text ~~* '%%'::text) OR (from_person_department_i.search_text ~~* '%%'::text) OR (from_person_team_i.search_text ~~* '%%'::text) OR (to_person_i.search_text ~~* '%%'::text) OR (to_person_department_i.search_text ~~* '%%'::text) OR (to_person_team_i.search_text ~~* '%%'::text))
5. 1,536.368 7,792.771 ↓ 199,075.0 796,300 1

Nested Loop Left Join (cost=6.14..3,302.64 rows=4 width=1,395) (actual time=0.164..7,792.771 rows=796,300 loops=1)

6. 1,208.231 3,867.503 ↓ 199,075.0 796,300 1

Nested Loop Left Join (cost=5.71..3,283.10 rows=4 width=1,185) (actual time=0.154..3,867.503 rows=796,300 loops=1)

7. 130.951 1,812.456 ↓ 13,231.5 52,926 1

Nested Loop Left Join (cost=5.28..3,269.53 rows=4 width=1,177) (actual time=0.144..1,812.456 rows=52,926 loops=1)

8. 158.996 1,522.727 ↓ 13,231.5 52,926 1

Nested Loop Left Join (cost=4.85..3,255.71 rows=4 width=967) (actual time=0.134..1,522.727 rows=52,926 loops=1)

9. 104.191 1,152.027 ↓ 13,231.5 52,926 1

Nested Loop Left Join (cost=4.42..3,222.04 rows=4 width=959) (actual time=0.127..1,152.027 rows=52,926 loops=1)

10. 144.378 889.058 ↓ 13,231.5 52,926 1

Nested Loop Left Join (cost=3.99..3,195.82 rows=4 width=749) (actual time=0.118..889.058 rows=52,926 loops=1)

11. 117.119 532.976 ↓ 13,231.5 52,926 1

Nested Loop Left Join (cost=3.56..3,182.24 rows=4 width=741) (actual time=0.107..532.976 rows=52,926 loops=1)

12. 81.872 257.079 ↓ 13,231.5 52,926 1

Nested Loop Left Join (cost=3.14..3,162.70 rows=4 width=531) (actual time=0.096..257.079 rows=52,926 loops=1)

13. 8.861 111.703 ↓ 882.0 3,528 1

Nested Loop Left Join (cost=2.71..3,149.13 rows=4 width=523) (actual time=0.084..111.703 rows=3,528 loops=1)

14. 10.278 88.730 ↓ 882.0 3,528 1

Nested Loop Left Join (cost=2.28..3,135.31 rows=4 width=313) (actual time=0.074..88.730 rows=3,528 loops=1)

15. 9.918 60.812 ↓ 882.0 3,528 1

Nested Loop Left Join (cost=1.85..3,101.63 rows=4 width=305) (actual time=0.064..60.812 rows=3,528 loops=1)

16. 5.241 33.254 ↓ 882.0 3,528 1

Nested Loop (cost=1.43..3,087.84 rows=4 width=297) (actual time=0.054..33.254 rows=3,528 loops=1)

17. 0.005 0.033 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.57..16.62 rows=1 width=230) (actual time=0.026..0.033 rows=1 loops=1)

  • Join Filter: (period_attr.bo_instance_id = period_i.id)
18. 0.020 0.020 ↑ 1.0 1 1

Index Scan using bo_instance_pkey on bo_instance period_i (cost=0.43..8.45 rows=1 width=193) (actual time=0.017..0.020 rows=1 loops=1)

  • Index Cond: (id = 6612983)
  • Filter: (NOT is_deleted)
19. 0.008 0.008 ↑ 1.0 1 1

Index Scan using idx_attrib_period_bo_instance_id on attrib_period period_attr (cost=0.14..8.16 rows=1 width=45) (actual time=0.005..0.008 rows=1 loops=1)

  • Index Cond: (bo_instance_id = 6612983)
20. 8.422 27.980 ↓ 882.0 3,528 1

Nested Loop (cost=0.86..3,071.18 rows=4 width=75) (actual time=0.025..27.980 rows=3,528 loops=1)

21. 5.446 5.446 ↓ 11.6 3,528 1

Index Scan using boi_rel_is_deleted_to_bo_instance_id_boc_rel_type_id_idx on boi_rel period_rel (cost=0.43..550.83 rows=303 width=16) (actual time=0.014..5.446 rows=3,528 loops=1)

  • Index Cond: ((is_deleted = false) AND (to_bo_instance_id = 6612983) AND (boc_rel_type_id = 15))
  • Filter: (NOT is_deleted)
22. 14.112 14.112 ↑ 1.0 1 3,528

Index Scan using bo_instance_pkey on bo_instance i (cost=0.43..8.32 rows=1 width=67) (actual time=0.004..0.004 rows=1 loops=3,528)

  • Index Cond: (id = period_rel.from_bo_instance_id)
  • Filter: ((NOT is_deleted) AND (bo_class_id = 9) AND (tenant_id = 314))
23. 17.640 17.640 ↑ 1.0 1 3,528

Index Scan using idx_attrib_kudos_bo_instance_id on attrib_kudos attr (cost=0.42..3.44 rows=1 width=16) (actual time=0.003..0.005 rows=1 loops=3,528)

  • Index Cond: (bo_instance_id = i.id)
24. 17.640 17.640 ↑ 3.0 1 3,528

Index Scan using boi_rel_is_deleted_to_bo_instance_id_boc_rel_type_id_idx on boi_rel from_person_rel (cost=0.43..8.39 rows=3 width=16) (actual time=0.004..0.005 rows=1 loops=3,528)

  • Index Cond: ((is_deleted = false) AND (to_bo_instance_id = i.id) AND (boc_rel_type_id = 32))
  • Filter: (NOT is_deleted)
25. 14.112 14.112 ↑ 1.0 1 3,528

Index Scan using bo_instance_pkey on bo_instance from_person_i (cost=0.43..3.46 rows=1 width=218) (actual time=0.004..0.004 rows=1 loops=3,528)

  • Index Cond: (id = from_person_rel.from_bo_instance_id)
  • Filter: (NOT is_deleted)
26. 63.504 63.504 ↓ 15.0 15 3,528

Index Scan using boi_rel_boc_rel_type_id_from_bo_instance_id_idx on boi_rel from_person_team_rel (cost=0.43..3.38 rows=1 width=16) (actual time=0.004..0.018 rows=15 loops=3,528)

  • Index Cond: ((boc_rel_type_id = 31) AND (from_bo_instance_id = from_person_i.id))
  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 0
27. 158.778 158.778 ↑ 1.0 1 52,926

Index Scan using bo_instance_pkey on bo_instance from_person_team_i (cost=0.43..4.88 rows=1 width=218) (actual time=0.003..0.003 rows=1 loops=52,926)

  • Index Cond: (id = from_person_team_rel.to_bo_instance_id)
  • Filter: (NOT is_deleted)
28. 211.704 211.704 ↑ 1.0 1 52,926

Index Scan using boi_rel_boc_rel_type_id_from_bo_instance_id_idx on boi_rel from_person_department_rel (cost=0.43..3.38 rows=1 width=16) (actual time=0.003..0.004 rows=1 loops=52,926)

  • Index Cond: ((boc_rel_type_id = 30) AND (from_bo_instance_id = from_person_i.id))
  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 0
29. 158.778 158.778 ↑ 1.0 1 52,926

Index Scan using bo_instance_pkey on bo_instance from_person_department_i (cost=0.43..6.56 rows=1 width=218) (actual time=0.003..0.003 rows=1 loops=52,926)

  • Index Cond: (id = from_person_department_rel.to_bo_instance_id)
  • Filter: (NOT is_deleted)
30. 211.704 211.704 ↑ 3.0 1 52,926

Index Scan using boi_rel_is_deleted_to_bo_instance_id_boc_rel_type_id_idx on boi_rel to_person_rel (cost=0.43..8.39 rows=3 width=16) (actual time=0.003..0.004 rows=1 loops=52,926)

  • Index Cond: ((is_deleted = false) AND (to_bo_instance_id = i.id) AND (boc_rel_type_id = 33))
  • Filter: (NOT is_deleted)
31. 158.778 158.778 ↑ 1.0 1 52,926

Index Scan using bo_instance_pkey on bo_instance to_person_i (cost=0.43..3.45 rows=1 width=218) (actual time=0.003..0.003 rows=1 loops=52,926)

  • Index Cond: (id = to_person_rel.from_bo_instance_id)
  • Filter: (NOT is_deleted)
32. 846.816 846.816 ↓ 15.0 15 52,926

Index Scan using boi_rel_boc_rel_type_id_from_bo_instance_id_idx on boi_rel to_person_team_rel (cost=0.43..3.38 rows=1 width=16) (actual time=0.003..0.016 rows=15 loops=52,926)

  • Index Cond: ((boc_rel_type_id = 31) AND (from_bo_instance_id = to_person_i.id))
  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 0
33. 2,388.900 2,388.900 ↑ 1.0 1 796,300

Index Scan using bo_instance_pkey on bo_instance to_person_team_i (cost=0.43..4.88 rows=1 width=218) (actual time=0.003..0.003 rows=1 loops=796,300)

  • Index Cond: (id = to_person_team_rel.to_bo_instance_id)
  • Filter: (NOT is_deleted)
34. 3,185.200 7,166.700 ↑ 1.0 1 796,300

Nested Loop Left Join (cost=0.86..9.94 rows=1 width=226) (actual time=0.007..0.009 rows=1 loops=796,300)

35. 2,388.900 2,388.900 ↑ 1.0 1 796,300

Index Scan using boi_rel_boc_rel_type_id_from_bo_instance_id_idx on boi_rel to_person_department_rel (cost=0.43..3.38 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=796,300)

  • Index Cond: ((boc_rel_type_id = 30) AND (from_bo_instance_id = to_person_i.id))
  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 0
36. 1,592.600 1,592.600 ↑ 1.0 1 796,300

Index Scan using bo_instance_pkey on bo_instance to_person_department_i (cost=0.43..6.56 rows=1 width=218) (actual time=0.002..0.002 rows=1 loops=796,300)

  • Index Cond: (id = to_person_department_rel.to_bo_instance_id)
  • Filter: (NOT is_deleted)
Planning time : 7.825 ms
Execution time : 21,675.817 ms