explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pbOL

Settings
# exclusive inclusive rows x rows loops node
1. 0.421 3,912.554 ↑ 7.7 70 1

Sort (cost=5,347,761.73..5,347,763.07 rows=536 width=325) (actual time=3,912.548..3,912.554 rows=70 loops=1)

  • Sort Key: ((SubPlan 1)), a.dname
  • Sort Method: quicksort Memory: 39kB
2. 2.603 3,912.133 ↑ 7.7 70 1

Hash Right Join (cost=1,073.18..5,347,737.44 rows=536 width=325) (actual time=58.469..3,912.133 rows=70 loops=1)

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

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

  • Filter: ((gid)::numeric = '10032'::numeric)
  • Rows Removed by Filter: 19,628
4. 0.035 5.078 ↑ 7.7 70 1

Hash (cost=1,065.14..1,065.14 rows=536 width=104) (actual time=5.078..5.078 rows=70 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 18kB
5. 0.069 5.043 ↑ 7.7 70 1

Nested Loop Left Join (cost=767.69..1,065.14 rows=536 width=104) (actual time=4.837..5.043 rows=70 loops=1)

6. 0.025 4.797 ↑ 8.4 59 1

Hash Left Join (cost=767.27..819.49 rows=493 width=86) (actual time=4.768..4.797 rows=59 loops=1)

  • Hash Cond: (a.kid_read = k.kid)
7. 0.175 4.725 ↑ 8.4 59 1

Hash Right Join (cost=761.95..807.40 rows=493 width=77) (actual time=4.710..4.725 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.148 0.148 ↑ 1.0 2,050 1

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

9. 0.018 4.402 ↑ 11.5 59 1

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

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

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

11. 0.001 4.342 ↑ 14.0 1 1

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

  • Join Filter: (g.gid = t2.gid)
12. 0.130 4.323 ↑ 14.0 1 1

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

  • Hash Cond: (t1.uplan_id = (t2.uplan_id)::numeric)
13. 0.287 0.287 ↓ 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.017..0.287 rows=1,055 loops=1)

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

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

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

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

16. 0.004 3.901 ↑ 36.0 1 1

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

17. 0.015 3.897 ↑ 1.4 25 1

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

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

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

  • Hash Cond: ((us.st_cod)::numeric = st.st_cod)
19. 1.120 1.120 ↑ 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.120 rows=14,898 loops=1)

20. 0.009 0.058 ↑ 1.0 25 1

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

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

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

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

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

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

Materialize (cost=0.43..16.48 rows=1 width=11) (actual time=0.017..0.018 rows=1 loops=1)

24. 0.004 0.014 ↑ 1.0 1 1

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

25. 0.006 0.006 ↑ 1.0 1 1

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

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

  • Index Cond: (sp_id = (g.spid)::numeric)
  • Heap Fetches: 1
27. 0.026 0.026 ↓ 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.009..0.026 rows=59 loops=1)

  • Index Cond: (uplan_id = t1.uplan_id)
28. 0.020 0.047 ↑ 1.0 103 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
29. 0.027 0.027 ↑ 1.0 103 1

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

30. 0.177 0.177 ↑ 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.003..0.003 rows=1 loops=59)

  • Index Cond: (subj_id = a.subj_id)
31.          

SubPlan (for Hash Right Join)

32. 0.210 0.210 ↑ 1.0 1 70

Seq Scan on control_type (cost=0.00..1.04 rows=1 width=118) (actual time=0.003..0.003 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. 0.840 3,515.470 ↑ 1.0 1 70

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

35. 3,514.630 3,514.630 ↓ 7.0 7 70

Seq Scan on examen_ocenki (cost=0.00..8,945.15 rows=1 width=2) (actual time=40.855..50.209 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.540 384.090 ↑ 1.0 1 70

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

37. 382.550 382.550 ↓ 0.0 0 70

Seq Scan on examen_vedomost (cost=0.00..1,026.25 rows=1 width=2) (actual time=4.501..5.465 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.775 ms
Execution time : 3,912.986 ms