explain.depesz.com

PostgreSQL's explain analyze made readable

Result: a7Cs

Settings
# exclusive inclusive rows x rows loops node
1. 41.320 2,508.063 ↓ 2.3 36,859 1

Hash Left Join (cost=1,506.91..19,001.71 rows=16,147 width=1,424) (actual time=63.962..2,508.063 rows=36,859 loops=1)

  • Hash Cond: ("Sitechecks".consultant_id = consultant.id)
2. 568.494 2,462.763 ↓ 2.3 36,859 1

Hash Semi Join (cost=1,346.86..18,799.23 rows=16,147 width=1,292) (actual time=59.938..2,462.763 rows=36,859 loops=1)

  • Hash Cond: ("Sitechecks".id = sitechecks.id)
3. 1,740.082 1,894.231 ↓ 2.1 2,352,842 1

Hash Left Join (cost=1,345.75..15,625.98 rows=1,140,001 width=1,292) (actual time=54.025..1,894.231 rows=2,352,842 loops=1)

  • Hash Cond: ("Sitechecks".template_id = template.id)
4. 64.825 153.897 ↓ 1.1 75,956 1

Hash Join (cost=1,336.60..2,592.19 rows=66,087 width=983) (actual time=53.758..153.897 rows=75,956 loops=1)

  • Hash Cond: ("Sitechecks".account_id = "account->equipment".account_id)
5. 11.096 79.500 ↓ 1.1 11,295 1

Hash Left Join (cost=1,076.17..1,406.76 rows=10,063 width=851) (actual time=44.147..79.500 rows=11,295 loops=1)

  • Hash Cond: (account.id = "account->suppliers".account_id)
6. 9.366 67.589 ↓ 1.1 11,049 1

Hash Left Join (cost=1,037.27..1,204.52 rows=10,035 width=770) (actual time=43.317..67.589 rows=11,049 loops=1)

  • Hash Cond: ("account->personnel".address_id = "account->personnel->address".id)
7. 14.297 56.658 ↓ 1.1 11,049 1

Hash Join (cost=974.27..1,115.16 rows=10,035 width=703) (actual time=41.730..56.658 rows=11,049 loops=1)

  • Hash Cond: ("Sitechecks".account_id = account.id)
8. 0.673 0.673 ↑ 1.0 1,412 1

Seq Scan on sitechecks "Sitechecks" (cost=0.00..31.12 rows=1,412 width=130) (actual time=0.004..0.673 rows=1,412 loops=1)

9. 7.931 41.688 ↑ 1.0 6,365 1

Hash (cost=892.07..892.07 rows=6,576 width=573) (actual time=41.687..41.688 rows=6,365 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 2609kB
10. 5.626 33.757 ↑ 1.0 6,365 1

Hash Join (cost=584.80..892.07 rows=6,576 width=573) (actual time=20.423..33.757 rows=6,365 loops=1)

  • Hash Cond: ("account->personnel->AccountsPersonnel".account_id = account.id)
11. 5.604 26.992 ↑ 1.0 6,365 1

Hash Join (cost=531.54..821.47 rows=6,576 width=340) (actual time=19.273..26.992 rows=6,365 loops=1)

  • Hash Cond: ("account->personnel->AccountsPersonnel".personnel_id = "account->personnel".id)
12. 2.159 2.159 ↓ 1.0 6,778 1

Seq Scan on accounts_personnel "account->personnel->AccountsPersonnel" (cost=0.00..198.77 rows=6,773 width=24) (actual time=0.006..2.159 rows=6,778 loops=1)

  • Filter: (leave_date IS NULL)
  • Rows Removed by Filter: 156
13. 2.895 19.229 ↑ 1.0 4,371 1

Hash (cost=475.96..475.96 rows=4,447 width=316) (actual time=19.229..19.229 rows=4,371 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 982kB
14. 2.993 16.334 ↑ 1.0 4,371 1

Hash Left Join (cost=277.45..475.96 rows=4,447 width=316) (actual time=8.100..16.334 rows=4,371 loops=1)

  • Hash Cond: ("account->personnel".id = "account->personnel->mot_groups->PersonnelMotGroups".personnel_id)
15. 2.749 9.246 ↑ 1.0 4,369 1

Hash Right Join (cost=158.39..303.02 rows=4,447 width=216) (actual time=3.986..9.246 rows=4,369 loops=1)

  • Hash Cond: ("account->personnel->roles->PersonnelRoles".personnel_id = "account->personnel".id)
16. 1.432 2.555 ↑ 1.0 3,208 1

Nested Loop (cost=0.00..136.02 rows=3,278 width=84) (actual time=0.011..2.555 rows=3,208 loops=1)

17. 0.005 0.005 ↑ 1.0 1 1

Seq Scan on roles "account->personnel->roles" (cost=0.00..1.15 rows=1 width=52) (actual time=0.004..0.005 rows=1 loops=1)

  • Filter: (id = 10)
  • Rows Removed by Filter: 11
18. 1.118 1.118 ↑ 1.0 3,208 1

Seq Scan on personnel_roles "account->personnel->roles->PersonnelRoles" (cost=0.00..102.09 rows=3,278 width=32) (actual time=0.004..1.118 rows=3,208 loops=1)

  • Filter: (role_id = 10)
  • Rows Removed by Filter: 1492
19. 2.025 3.942 ↑ 1.0 4,369 1

Hash (cost=102.80..102.80 rows=4,447 width=132) (actual time=3.942..3.942 rows=4,369 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 479kB
20. 1.917 1.917 ↑ 1.0 4,369 1

Seq Scan on personnel "account->personnel" (cost=0.00..102.80 rows=4,447 width=132) (actual time=0.004..1.917 rows=4,369 loops=1)

  • Filter: is_active
  • Rows Removed by Filter: 159
21. 1.400 4.095 ↓ 1.0 3,271 1

Hash (cost=78.32..78.32 rows=3,259 width=100) (actual time=4.095..4.095 rows=3,271 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 440kB
22. 1.906 2.695 ↓ 1.0 3,271 1

Hash Join (cost=1.04..78.32 rows=3,259 width=100) (actual time=0.021..2.695 rows=3,271 loops=1)

  • Hash Cond: ("account->personnel->mot_groups->PersonnelMotGroups".mot_group_id = "account->personnel->mot_groups".id)
23. 0.783 0.783 ↓ 1.0 3,271 1

Seq Scan on personnel_mot_groups "account->personnel->mot_groups->PersonnelMotGroups" (cost=0.00..50.59 rows=3,259 width=16) (actual time=0.006..0.783 rows=3,271 loops=1)

24. 0.003 0.006 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=84) (actual time=0.006..0.006 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
25. 0.003 0.003 ↑ 1.0 2 1

Seq Scan on mot_class_groups "account->personnel->mot_groups" (cost=0.00..1.02 rows=2 width=84) (actual time=0.002..0.003 rows=2 loops=1)

26. 0.630 1.139 ↑ 1.0 962 1

Hash (cost=40.89..40.89 rows=989 width=233) (actual time=1.139..1.139 rows=962 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 236kB
27. 0.509 0.509 ↑ 1.0 962 1

Seq Scan on accounts account (cost=0.00..40.89 rows=989 width=233) (actual time=0.004..0.509 rows=962 loops=1)

  • Filter: is_active
28. 0.903 1.565 ↓ 1.0 1,781 1

Hash (cost=40.78..40.78 rows=1,778 width=67) (actual time=1.565..1.565 rows=1,781 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 194kB
29. 0.662 0.662 ↓ 1.0 1,781 1

Seq Scan on addresses "account->personnel->address" (cost=0.00..40.78 rows=1,778 width=67) (actual time=0.008..0.662 rows=1,781 loops=1)

30. 0.459 0.815 ↑ 1.1 1,009 1

Hash (cost=25.62..25.62 rows=1,062 width=81) (actual time=0.814..0.815 rows=1,009 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 133kB
31. 0.356 0.356 ↑ 1.1 1,009 1

Seq Scan on suppliers "account->suppliers" (cost=0.00..25.62 rows=1,062 width=81) (actual time=0.008..0.356 rows=1,009 loops=1)

32. 3.590 9.572 ↑ 1.0 6,206 1

Hash (cost=182.66..182.66 rows=6,222 width=132) (actual time=9.572..9.572 rows=6,206 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 1062kB
33. 3.826 5.982 ↑ 1.0 6,206 1

Hash Left Join (cost=1.70..182.66 rows=6,222 width=132) (actual time=0.044..5.982 rows=6,206 loops=1)

  • Hash Cond: ("account->equipment".text_id = "account->equipment->text_item".id)
34. 2.126 2.126 ↑ 1.0 6,206 1

Seq Scan on equipment "account->equipment" (cost=0.00..162.39 rows=6,222 width=72) (actual time=0.005..2.126 rows=6,206 loops=1)

  • Filter: is_active
  • Rows Removed by Filter: 151
35. 0.019 0.030 ↓ 1.1 33 1

Hash (cost=1.31..1.31 rows=31 width=60) (actual time=0.030..0.030 rows=33 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
36. 0.011 0.011 ↓ 1.1 33 1

Seq Scan on text_items "account->equipment->text_item" (cost=0.00..1.31 rows=31 width=60) (actual time=0.003..0.011 rows=33 loops=1)

37. 0.082 0.252 ↓ 1.3 69 1

Hash (cost=8.50..8.50 rows=52 width=309) (actual time=0.252..0.252 rows=69 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 67kB
38. 0.050 0.170 ↓ 1.3 69 1

Hash Left Join (cost=2.11..8.50 rows=52 width=309) (actual time=0.060..0.170 rows=69 loops=1)

  • Hash Cond: (template.template_type_id = "template->template_type".id)
39. 0.061 0.101 ↓ 1.3 69 1

Hash Right Join (cost=1.07..7.13 rows=52 width=273) (actual time=0.030..0.101 rows=69 loops=1)

  • Hash Cond: ("template->questions".template_id = template.id)
40. 0.026 0.026 ↑ 1.0 69 1

Seq Scan on questions "template->questions" (cost=0.00..5.69 rows=69 width=185) (actual time=0.004..0.026 rows=69 loops=1)

41. 0.008 0.014 ↓ 1.3 4 1

Hash (cost=1.03..1.03 rows=3 width=88) (actual time=0.014..0.014 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
42. 0.006 0.006 ↓ 1.3 4 1

Seq Scan on templates template (cost=0.00..1.03 rows=3 width=88) (actual time=0.005..0.006 rows=4 loops=1)

43. 0.015 0.019 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=36) (actual time=0.019..0.019 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
44. 0.004 0.004 ↑ 1.0 2 1

Seq Scan on template_types "template->template_type" (cost=0.00..1.02 rows=2 width=36) (actual time=0.003..0.004 rows=2 loops=1)

45. 0.012 0.038 ↑ 1.0 20 1

Hash (cost=0.86..0.86 rows=20 width=4) (actual time=0.038..0.038 rows=20 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
46. 0.010 0.026 ↑ 1.0 20 1

Limit (cost=0.00..0.66 rows=20 width=4) (actual time=0.011..0.026 rows=20 loops=1)

47. 0.016 0.016 ↑ 52.2 20 1

Seq Scan on sitechecks (cost=0.00..34.65 rows=1,045 width=4) (actual time=0.010..0.016 rows=20 loops=1)

  • Filter: (status = 'stub'::enum_sitechecks_status)
  • Rows Removed by Filter: 2
48. 2.123 3.980 ↑ 1.0 4,528 1

Hash (cost=102.80..102.80 rows=4,580 width=132) (actual time=3.980..3.980 rows=4,528 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 495kB
49. 1.857 1.857 ↑ 1.0 4,528 1

Seq Scan on personnel consultant (cost=0.00..102.80 rows=4,580 width=132) (actual time=0.007..1.857 rows=4,528 loops=1)