explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JwXG

Settings
# exclusive inclusive rows x rows loops node
1. 0.483 4,662.920 ↑ 7.7 70 1

Sort (cost=5,347,761.68..5,347,763.02 rows=536 width=325) (actual time=4,662.915..4,662.920 rows=70 loops=1)

  • Sort Key: ((SubPlan 1)), a.dname
  • Sort Method: quicksort Memory: 39kB
2. 2.913 4,662.437 ↑ 7.7 70 1

Hash Join (cost=820.53..5,347,737.38 rows=536 width=325) (actual time=82.777..4,662.437 rows=70 loops=1)

  • Hash Cond: (a.kid_read = k.kid)
3. 0.239 12.513 ↑ 7.7 70 1

Nested Loop Left Join (cost=815.21..1,891.17 rows=536 width=124) (actual time=6.811..12.513 rows=70 loops=1)

4. 0.162 11.507 ↑ 8.4 59 1

Hash Right Join (cost=814.79..1,645.53 rows=493 width=106) (actual time=6.801..11.507 rows=59 loops=1)

  • Hash Cond: (((ev.gid)::numeric = t2.gid) AND ((ev.subj_id)::numeric = a.subj_id))
5. 4.823 4.823 ↑ 4.5 22 1

Seq Scan on examen_vedomost ev (cost=0.00..829.75 rows=98 width=37) (actual time=0.266..4.823 rows=22 loops=1)

  • Filter: ((gid)::numeric = '10032'::numeric)
  • Rows Removed by Filter: 19,628
6. 0.029 6.522 ↑ 8.4 59 1

Hash (cost=807.40..807.40 rows=493 width=77) (actual time=6.522..6.522 rows=59 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
7. 0.216 6.493 ↑ 8.4 59 1

Hash Right Join (cost=761.95..807.40 rows=493 width=77) (actual time=6.476..6.493 rows=59 loops=1)

  • Hash Cond: (t3.ub_id = a.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.185 0.185 ↑ 1.0 2,050 1

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

9. 0.020 6.092 ↑ 11.5 59 1

Hash (cost=753.47..753.47 rows=679 width=86) (actual time=6.092..6.092 rows=59 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
10. 0.020 6.072 ↑ 11.5 59 1

Nested Loop (cost=499.99..753.47 rows=679 width=86) (actual time=5.842..6.072 rows=59 loops=1)

11. 0.003 6.023 ↑ 14.0 1 1

Nested Loop Left Join (cost=499.57..584.38 rows=14 width=20) (actual time=5.829..6.023 rows=1 loops=1)

  • Join Filter: (g.gid = t2.gid)
12. 0.158 5.995 ↑ 14.0 1 1

Hash Join (cost=499.14..567.69 rows=14 width=15) (actual time=5.803..5.995 rows=1 loops=1)

  • Hash Cond: (t1.uplan_id = (t2.uplan_id)::numeric)
13. 0.333 0.333 ↓ 1.3 1,055 1

Index Scan using uplan_idx_final_flag_dek01 on uplan t1 (cost=0.28..64.60 rows=817 width=5) (actual time=0.015..0.333 rows=1,055 loops=1)

  • Index Cond: (final_flag_dek = 1)
  • Filter: (status = 0)
  • Rows Removed by Filter: 11
14. 0.015 5.504 ↑ 36.0 1 1

Hash (cost=498.41..498.41 rows=36 width=10) (actual time=5.504..5.504 rows=1 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
15. 0.001 5.489 ↑ 36.0 1 1

Subquery Scan on t2 (cost=497.78..498.41 rows=36 width=10) (actual time=5.482..5.489 rows=1 loops=1)

16. 0.005 5.488 ↑ 36.0 1 1

Unique (cost=497.78..498.05 rows=36 width=42) (actual time=5.481..5.488 rows=1 loops=1)

17. 0.021 5.483 ↑ 1.4 25 1

Sort (cost=497.78..497.87 rows=36 width=42) (actual time=5.480..5.483 rows=25 loops=1)

  • Sort Key: (concat(us.uplan_id, ' ', st.gid)), us.uplan_id
  • Sort Method: quicksort Memory: 26kB
18. 3.612 5.462 ↑ 1.4 25 1

Hash Join (cost=89.93..496.85 rows=36 width=42) (actual time=0.159..5.462 rows=25 loops=1)

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

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

20. 0.009 0.066 ↑ 1.0 25 1

Hash (cost=89.62..89.62 rows=25 width=12) (actual time=0.066..0.066 rows=25 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
21. 0.043 0.057 ↑ 1.0 25 1

Bitmap Heap Scan on st (cost=4.48..89.62 rows=25 width=12) (actual time=0.022..0.057 rows=25 loops=1)

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

Bitmap Index Scan on st_gid (cost=0.00..4.47 rows=25 width=0) (actual time=0.014..0.014 rows=25 loops=1)

  • Index Cond: (gid = '10032'::numeric)
23. 0.005 0.025 ↑ 1.0 1 1

Materialize (cost=0.43..16.48 rows=1 width=11) (actual time=0.024..0.025 rows=1 loops=1)

24. 0.006 0.020 ↑ 1.0 1 1

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

25. 0.009 0.009 ↑ 1.0 1 1

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

  • Index Cond: (gid = '10032'::numeric)
26. 0.005 0.005 ↑ 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.004..0.005 rows=1 loops=1)

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

Index Scan using idx_subject_uplanid on subject a (cost=0.42..11.58 rows=50 width=75) (actual time=0.010..0.029 rows=59 loops=1)

  • Index Cond: (uplan_id = t1.uplan_id)
28. 0.767 0.767 ↑ 1.0 1 59

Index Scan using idx_subject_semester_subjid on subject_semester b (cost=0.42..0.49 rows=1 width=24) (actual time=0.011..0.013 rows=1 loops=59)

  • Index Cond: (subj_id = a.subj_id)
29. 0.026 0.061 ↑ 1.0 103 1

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

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

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

31.          

SubPlan (for Hash Join)

32. 0.280 0.280 ↑ 1.0 1 70

Seq Scan on control_type (cost=0.00..1.04 rows=1 width=118) (actual time=0.003..0.004 rows=1 loops=70)

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

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

  • Filter: (iz_id = b.iz_id)
  • Rows Removed by Filter: 6
34. 1.050 4,196.290 ↑ 1.0 1 70

Aggregate (cost=8,945.16..8,945.17 rows=1 width=32) (actual time=59.946..59.947 rows=1 loops=70)

35. 4,195.240 4,195.240 ↓ 7.0 7 70

Seq Scan on examen_ocenki (cost=0.00..8,945.15 rows=1 width=2) (actual time=48.284..59.932 rows=7 loops=70)

  • Filter: (((semester)::numeric = b.semester) AND ((gid)::numeric = t2.gid) AND ((subj_id)::numeric = a.subj_id))
  • Rows Removed by Filter: 164,999
36. 1.680 450.240 ↑ 1.0 1 70

Aggregate (cost=1,026.25..1,026.26 rows=1 width=8) (actual time=6.432..6.432 rows=1 loops=70)

37. 448.560 448.560 ↓ 0.0 0 70

Seq Scan on examen_vedomost (cost=0.00..1,026.25 rows=1 width=2) (actual time=5.250..6.408 rows=0 loops=70)

  • Filter: (((semester)::numeric = b.semester) AND ((gid)::numeric = t2.gid) AND ((subj_id)::numeric = a.subj_id))
  • Rows Removed by Filter: 19,650
Planning time : 4.676 ms
Execution time : 4,663.422 ms