explain.depesz.com

PostgreSQL's explain analyze made readable

Result: G3FX

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 6.546 ↓ 3.5 7 1

Limit (cost=6.42..966.95 rows=2 width=0) (actual time=1.080..6.546 rows=7 loops=1)

2. 0.788 6.539 ↓ 3.5 7 1

Nested Loop Left Join (cost=6.42..966.95 rows=2 width=0) (actual time=1.078..6.539 rows=7 loops=1)

  • Filter: ((profiles_enrolment.profile_id = 1) OR (profiles_classroomrole.profile_id = 1))
  • Rows Removed by Filter: 2214
3. 0.137 2.813 ↑ 2.1 226 1

Nested Loop Left Join (cost=6.00..512.08 rows=472 width=8) (actual time=0.224..2.813 rows=226 loops=1)

4. 0.018 0.408 ↑ 1.4 18 1

Nested Loop (cost=5.45..101.74 rows=25 width=4) (actual time=0.199..0.408 rows=18 loops=1)

5. 0.006 0.205 ↓ 2.5 5 1

Nested Loop (cost=5.03..68.04 rows=2 width=4) (actual time=0.145..0.205 rows=5 loops=1)

6. 0.004 0.141 ↑ 1.0 2 1

Nested Loop (cost=4.74..66.53 rows=2 width=4) (actual time=0.136..0.141 rows=2 loops=1)

7. 0.089 0.089 ↑ 2.0 1 1

Index Scan using tod_branch_slug on tod_branch t8 (cost=0.41..12.44 rows=2 width=4) (actual time=0.088..0.089 rows=1 loops=1)

  • Index Cond: ((slug)::text = 'edrolo'::text)
8. 0.015 0.048 ↑ 3.0 2 1

Bitmap Heap Scan on tod_branch t7 (cost=4.33..26.98 rows=6 width=8) (actual time=0.044..0.048 rows=2 loops=1)

  • Recheck Cond: (parent_id = t8.id)
  • Heap Blocks: exact=2
9. 0.033 0.033 ↑ 3.0 2 1

Bitmap Index Scan on tod_branch_parent_id (cost=0.00..4.33 rows=6 width=0) (actual time=0.033..0.033 rows=2 loops=1)

  • Index Cond: (parent_id = t8.id)
10. 0.058 0.058 ↑ 3.0 2 2

Index Scan using tod_branch_parent_id on tod_branch (cost=0.29..0.70 rows=6 width=8) (actual time=0.012..0.029 rows=2 loops=2)

  • Index Cond: (parent_id = t7.id)
11. 0.185 0.185 ↑ 124.2 4 5

Index Scan using profiles_schoolclass_branch_id on profiles_schoolclass (cost=0.42..11.88 rows=497 width=8) (actual time=0.021..0.037 rows=4 loops=5)

  • Index Cond: (branch_id = tod_branch.id)
  • Filter: is_active
12. 2.268 2.268 ↑ 4.7 12 18

Index Scan using profiles_enrolment_a66276ff on profiles_enrolment (cost=0.56..15.85 rows=56 width=8) (actual time=0.014..0.126 rows=12 loops=18)

  • Index Cond: (profiles_schoolclass.id = school_class_id)
13. 2.938 2.938 ↑ 1.3 9 226

Index Scan using profiles_classroomrole_a66276ff on profiles_classroomrole (cost=0.42..0.78 rows=12 width=8) (actual time=0.002..0.013 rows=9 loops=226)

  • Index Cond: (profiles_schoolclass.id = school_class_id)
Planning time : 3.463 ms
Execution time : 6.663 ms