explain.depesz.com

PostgreSQL's explain analyze made readable

Result: RNvG

Settings
# exclusive inclusive rows x rows loops node
1. 0.202 1,004.452 ↑ 9.0 11 1

Sort (cost=989,506.96..989,507.21 rows=99 width=331) (actual time=1,004.450..1,004.452 rows=11 loops=1)

  • Sort Key: ((SubPlan 1)), a.dname
  • Sort Method: quicksort Memory: 27kB
2. 0.796 1,004.250 ↑ 9.0 11 1

Hash Join (cost=863.92..989,503.68 rows=99 width=331) (actual time=161.083..1,004.250 rows=11 loops=1)

  • Hash Cond: (a.kid_read = k.kid)
3. 0.116 45.190 ↑ 9.0 11 1

Nested Loop (cost=858.60..2,113.57 rows=99 width=130) (actual time=27.271..45.190 rows=11 loops=1)

4. 0.158 30.983 ↑ 13.9 61 1

Hash Right Join (cost=858.19..1,688.93 rows=848 width=112) (actual time=26.365..30.983 rows=61 loops=1)

  • Hash Cond: (((ev.gid)::numeric = t2.gid) AND ((ev.subj_id)::numeric = a.subj_id))
5. 5.795 5.795 ↑ 3.5 28 1

Seq Scan on examen_vedomost ev (cost=0.00..829.75 rows=98 width=43) (actual time=1.293..5.795 rows=28 loops=1)

  • Filter: ((gid)::numeric = '10416'::numeric)
  • Rows Removed by Filter: 19,622
6. 0.076 25.030 ↑ 14.4 59 1

Hash (cost=845.47..845.47 rows=848 width=77) (actual time=25.030..25.030 rows=59 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
7. 0.106 24.954 ↑ 14.4 59 1

Hash Left Join (cost=550.01..845.47 rows=848 width=77) (actual time=20.848..24.954 rows=59 loops=1)

  • Hash Cond: (a.ub_id = t3.ub_id)
  • Filter: (((t3.ub_id = a.ub_id) AND (z.sp_id = (t3.sp_id)::numeric)) OR (a.ub_id IS NULL))
8. 0.047 23.348 ↑ 19.8 59 1

Nested Loop (cost=489.89..775.34 rows=1,169 width=86) (actual time=19.294..23.348 rows=59 loops=1)

9. 0.008 19.713 ↑ 24.0 1 1

Nested Loop Left Join (cost=489.47..587.95 rows=24 width=20) (actual time=18.794..19.713 rows=1 loops=1)

  • Join Filter: (g.gid = t2.gid)
10. 0.273 18.858 ↑ 24.0 1 1

Hash Join (cost=489.04..571.11 rows=24 width=15) (actual time=17.943..18.858 rows=1 loops=1)

  • Hash Cond: (t1.uplan_id = (t2.uplan_id)::numeric)
11. 2.061 2.061 ↑ 1.0 1,634 1

Seq Scan on uplan t1 (cost=0.00..73.66 rows=1,634 width=5) (actual time=0.294..2.061 rows=1,634 loops=1)

  • Filter: (status = 0)
  • Rows Removed by Filter: 499
12. 0.016 16.524 ↑ 31.0 1 1

Hash (cost=488.65..488.65 rows=31 width=10) (actual time=16.524..16.524 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
13. 0.002 16.508 ↑ 31.0 1 1

Subquery Scan on t2 (cost=488.11..488.65 rows=31 width=10) (actual time=16.502..16.508 rows=1 loops=1)

14. 0.005 16.506 ↑ 31.0 1 1

Unique (cost=488.11..488.34 rows=31 width=42) (actual time=16.500..16.506 rows=1 loops=1)

15. 0.068 16.501 ↑ 1.4 22 1

Sort (cost=488.11..488.19 rows=31 width=42) (actual time=16.499..16.501 rows=22 loops=1)

  • Sort Key: (concat(us.uplan_id, ' ', st.gid)), us.uplan_id
  • Sort Method: quicksort Memory: 26kB
16. 4.512 16.433 ↑ 1.4 22 1

Hash Join (cost=80.49..487.34 rows=31 width=42) (actual time=15.980..16.433 rows=22 loops=1)

  • Hash Cond: ((us.st_cod)::numeric = st.st_cod)
17. 4.724 4.724 ↑ 1.0 14,898 1

Seq Scan on uplan_student us (cost=0.00..331.98 rows=14,898 width=8) (actual time=0.327..4.724 rows=14,898 loops=1)

18. 0.093 7.197 ↑ 1.0 22 1

Hash (cost=80.21..80.21 rows=22 width=12) (actual time=7.197..7.197 rows=22 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
19. 6.985 7.104 ↑ 1.0 22 1

Bitmap Heap Scan on st (cost=4.46..80.21 rows=22 width=12) (actual time=0.626..7.104 rows=22 loops=1)

  • Recheck Cond: (gid = '10416'::numeric)
  • Filter: (sst <> ALL ('{2,3}'::integer[]))
  • Heap Blocks: exact=21
20. 0.119 0.119 ↑ 1.0 22 1

Bitmap Index Scan on st_gid (cost=0.00..4.45 rows=22 width=0) (actual time=0.119..0.119 rows=22 loops=1)

  • Index Cond: (gid = '10416'::numeric)
21. 0.008 0.847 ↑ 1.0 1 1

Materialize (cost=0.43..16.48 rows=1 width=11) (actual time=0.844..0.847 rows=1 loops=1)

22. 0.023 0.839 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.43..16.48 rows=1 width=11) (actual time=0.837..0.839 rows=1 loops=1)

23. 0.303 0.303 ↑ 1.0 1 1

Index Scan using grupa_pkey on grupa g (cost=0.28..8.30 rows=1 width=8) (actual time=0.302..0.303 rows=1 loops=1)

  • Index Cond: (gid = '10416'::numeric)
24. 0.513 0.513 ↑ 1.0 1 1

Index Only Scan using specialization_pkey on specialization z (cost=0.15..8.17 rows=1 width=5) (actual time=0.512..0.513 rows=1 loops=1)

  • Index Cond: (sp_id = (g.spid)::numeric)
  • Heap Fetches: 1
25. 3.588 3.588 ↓ 1.2 59 1

Index Scan using idx_subject_uplanid on subject a (cost=0.42..7.31 rows=50 width=75) (actual time=0.494..3.588 rows=59 loops=1)

  • Index Cond: (uplan_id = t1.uplan_id)
26. 0.401 1.500 ↑ 1.0 2,050 1

Hash (cost=34.50..34.50 rows=2,050 width=8) (actual time=1.500..1.500 rows=2,050 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 113kB
27. 1.099 1.099 ↑ 1.0 2,050 1

Seq Scan on uplan_block t3 (cost=0.00..34.50 rows=2,050 width=8) (actual time=0.030..1.099 rows=2,050 loops=1)

28. 14.091 14.091 ↓ 0.0 0 61

Index Scan using idx_subject_semester_subjid on subject_semester b (cost=0.42..0.49 rows=1 width=24) (actual time=0.231..0.231 rows=0 loops=61)

  • Index Cond: (subj_id = a.subj_id)
  • Filter: (semester = '4'::numeric)
  • Rows Removed by Filter: 1
29. 0.050 0.120 ↑ 1.0 103 1

Hash (cost=4.03..4.03 rows=103 width=11) (actual time=0.120..0.120 rows=103 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
30. 0.070 0.070 ↑ 1.0 103 1

Seq Scan on kafedra k (cost=0.00..4.03 rows=103 width=11) (actual time=0.028..0.070 rows=103 loops=1)

31.          

SubPlan (for Hash Join)

32. 0.462 0.462 ↑ 1.0 1 11

Seq Scan on control_type (cost=0.00..1.04 rows=1 width=118) (actual time=0.041..0.042 rows=1 loops=11)

  • Filter: (ct_id = (b.ct_id)::numeric)
  • Rows Removed by Filter: 2
33. 0.462 0.462 ↑ 1.0 1 11

Seq Scan on indzav_type (cost=0.00..1.09 rows=1 width=24) (actual time=0.042..0.042 rows=1 loops=11)

  • Filter: (iz_id = b.iz_id)
  • Rows Removed by Filter: 6
34. 0.220 887.777 ↑ 1.0 1 11

Aggregate (cost=8,945.16..8,945.17 rows=1 width=32) (actual time=80.707..80.707 rows=1 loops=11)

35. 887.557 887.557 ↓ 12.0 12 11

Seq Scan on examen_ocenki (cost=0.00..8,945.15 rows=1 width=2) (actual time=24.759..80.687 rows=12 loops=11)

  • Filter: (((semester)::numeric = b.semester) AND ((gid)::numeric = t2.gid) AND ((subj_id)::numeric = a.subj_id))
  • Rows Removed by Filter: 164,994
36. 0.165 69.443 ↑ 1.0 1 11

Aggregate (cost=1,026.25..1,026.26 rows=1 width=8) (actual time=6.312..6.313 rows=1 loops=11)

37. 69.278 69.278 ↑ 1.0 1 11

Seq Scan on examen_vedomost (cost=0.00..1,026.25 rows=1 width=2) (actual time=0.963..6.298 rows=1 loops=11)

  • Filter: (((semester)::numeric = b.semester) AND ((gid)::numeric = t2.gid) AND ((subj_id)::numeric = a.subj_id))
  • Rows Removed by Filter: 19,649
Planning time : 233.852 ms
Execution time : 1,005.287 ms