explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tKGP

Settings
# exclusive inclusive rows x rows loops node
1. 3.393 142,774.050 ↓ 4,213.0 4,213 1

Unique (cost=607.12..607.14 rows=1 width=46) (actual time=142,769.184..142,774.050 rows=4,213 loops=1)

2. 38.413 142,770.657 ↓ 6,481.0 6,481 1

Sort (cost=607.12..607.12 rows=1 width=46) (actual time=142,769.182..142,770.657 rows=6,481 loops=1)

  • Sort Key: ssg.student_id, sched.syear, sched.gradelevel, sta.standard_code, mp.mp, ssg.grade_title, ssg.last_modified_date
  • Sort Method: quicksort Memory: 745kB
3. 1,143.646 142,732.244 ↓ 6,481.0 6,481 1

Nested Loop (cost=6.99..607.11 rows=1 width=46) (actual time=48.432..142,732.244 rows=6,481 loops=1)

  • Join Filter: ((ssg.marking_period_id)::numeric = mp.marking_period_id)
  • Rows Removed by Join Filter: 2352603
4. 50,930.641 140,370.170 ↓ 25,924.0 25,924 1

Nested Loop (cost=6.85..603.80 rows=1 width=54) (actual time=16.751..140,370.170 rows=25,924 loops=1)

  • Join Filter: (((sched.course_num)::text = (ssg.course_num)::text) AND (sched.student_id = (ssg.student_id)::numeric) AND (sched.syear = (ssg.syear)::numeric))
  • Rows Removed by Join Filter: 129828872
5. 29.685 130.881 ↓ 13,288.0 13,288 1

Nested Loop (cost=6.42..136.14 rows=1 width=88) (actual time=8.105..130.881 rows=13,288 loops=1)

6. 7.225 61.368 ↓ 663.8 6,638 1

Nested Loop (cost=6.27..133.55 rows=10 width=60) (actual time=8.021..61.368 rows=6,638 loops=1)

7. 11.997 47.231 ↓ 128.0 128 1

Nested Loop (cost=5.98..132.93 rows=1 width=44) (actual time=8.006..47.231 rows=128 loops=1)

  • Join Filter: ((rmp.syear = sched.syear) AND (rmp.school_id = sched.school_id))
  • Rows Removed by Join Filter: 11520
8. 3.360 6.478 ↓ 798.8 7,189 1

Nested Loop (cost=5.56..53.64 rows=9 width=26) (actual time=0.044..6.478 rows=7,189 loops=1)

9. 0.063 0.206 ↓ 91.0 91 1

Nested Loop (cost=5.14..29.66 rows=1 width=26) (actual time=0.034..0.206 rows=91 loops=1)

10. 0.012 0.012 ↑ 1.0 1 1

Index Scan using ssrs_batch_id on ssrs_batch ssrs (cost=0.29..8.30 rows=1 width=19) (actual time=0.010..0.012 rows=1 loops=1)

  • Index Cond: (id = 17885)
11. 0.117 0.131 ↑ 1.0 91 1

Bitmap Heap Scan on rptcrd_mp rmp (cost=4.85..20.45 rows=91 width=13) (actual time=0.021..0.131 rows=91 loops=1)

  • Recheck Cond: ((mp)::text = (ssrs.marking_period)::text)
  • Filter: ((ssrs.syear)::numeric = syear)
  • Heap Blocks: exact=10
12. 0.014 0.014 ↑ 1.0 91 1

Bitmap Index Scan on rptcrd_mp_mps (cost=0.00..4.83 rows=91 width=0) (actual time=0.014..0.014 rows=91 loops=1)

  • Index Cond: ((mp)::text = (ssrs.marking_period)::text)
13. 2.912 2.912 ↓ 4.2 79 91

Index Scan using ssrs_batch_record_ssrs_batch_id on ssrs_batch_record sbr (cost=0.42..23.79 rows=19 width=16) (actual time=0.004..0.032 rows=79 loops=91)

  • Index Cond: (ssrs_batch_id = 17885)
14. 28.756 28.756 ↑ 3.5 2 7,189

Index Scan using indx_rptcrd_sched_student on rptcrd_es_sched sched (cost=0.42..8.71 rows=7 width=28) (actual time=0.004..0.004 rows=2 loops=7,189)

  • Index Cond: (student_id = (sbr.source_id)::numeric)
  • Filter: ((pull_data)::text = 'Y'::text)
  • Rows Removed by Filter: 2
15. 6.912 6.912 ↓ 4.3 52 128

Index Scan using "f:i:standards_join_courses:course_num" on standards_join_courses sjc (cost=0.29..0.50 rows=12 width=16) (actual time=0.010..0.054 rows=52 loops=128)

  • Index Cond: ((course_num)::text = (sched.course_num)::text)
16. 39.828 39.828 ↑ 2.0 2 6,638

Index Scan using ix_rptcrd_stnd_id on rptcrd_es_standards sta (cost=0.15..0.22 rows=4 width=28) (actual time=0.003..0.006 rows=2 loops=6,638)

  • Index Cond: (id = sjc.standard_id)
17. 89,308.648 89,308.648 ↓ 23.9 9,772 13,288

Index Scan using "f:i:student_standard_grades:standard_id" on student_standard_grades ssg (cost=0.43..458.46 rows=409 width=47) (actual time=0.010..6.721 rows=9,772 loops=13,288)

  • Index Cond: (standard_id = sjc.standard_id)
  • Filter: ((grade_title IS NOT NULL) AND ((sjc.course_num)::text = (course_num)::text))
  • Rows Removed by Filter: 147
18. 1,218.428 1,218.428 ↑ 1.0 91 25,924

Index Scan using rptcrd_mp_mps on rptcrd_mp mp (cost=0.15..1.94 rows=91 width=8) (actual time=0.008..0.047 rows=91 loops=25,924)

  • Index Cond: ((mp)::text = (sta.mp)::text)