| 1 | ######## rep_student_dossier ########
|
|---|
| 2 | Sort (cost=10637.89..10647.89 rows=4000 width=167) (actual time=176.610..176.798 rows=4000.00 loops=1)
|
|---|
| 3 | Sort Key: (COALESCE(ps.credits, '0'::bigint)) DESC, (COALESCE(ps.average_grade, '0'::numeric)) DESC, u.index
|
|---|
| 4 | Sort Method: quicksort Memory: 597kB
|
|---|
| 5 | Buffers: shared hit=74402
|
|---|
| 6 | -> Hash Left Join (cost=10176.52..10398.57 rows=4000 width=167) (actual time=152.524..158.937 rows=4000.00 loops=1)
|
|---|
| 7 | Hash Cond: (u.id = doc.user_id)
|
|---|
| 8 | Buffers: shared hit=74393
|
|---|
| 9 | -> Hash Left Join (cost=9941.27..10112.82 rows=4000 width=113) (actual time=148.736..153.409 rows=4000.00 loops=1)
|
|---|
| 10 | Hash Cond: (u.id = pay.user_id)
|
|---|
| 11 | Buffers: shared hit=74374
|
|---|
| 12 | -> Hash Left Join (cost=8928.26..9089.30 rows=4000 width=105) (actual time=138.645..142.335 rows=4000.00 loops=1)
|
|---|
| 13 | Hash Cond: (u.id = pen.user_id)
|
|---|
| 14 | Buffers: shared hit=74133
|
|---|
| 15 | -> Hash Left Join (cost=5790.89..5941.41 rows=4000 width=97) (actual time=77.269..80.169 rows=4000.00 loops=1)
|
|---|
| 16 | Hash Cond: (u.id = sem.user_id)
|
|---|
| 17 | Buffers: shared hit=1266
|
|---|
| 18 | -> Hash Left Join (cost=5226.89..5366.90 rows=4000 width=81) (actual time=72.908..74.881 rows=4000.00 loops=1)
|
|---|
| 19 | Hash Cond: (u.id = ps.user_id)
|
|---|
| 20 | Buffers: shared hit=1112
|
|---|
| 21 | -> Seq Scan on users u (cost=0.00..129.50 rows=4000 width=33) (actual time=0.037..1.039 rows=4000.00 loops=1)
|
|---|
| 22 | Filter: (role = 'student'::user_role)
|
|---|
| 23 | Rows Removed by Filter: 120
|
|---|
| 24 | Buffers: shared hit=78
|
|---|
| 25 | -> Hash (cost=5176.89..5176.89 rows=4000 width=52) (actual time=72.852..72.861 rows=4000.00 loops=1)
|
|---|
| 26 | Buckets: 4096 Batches: 1 Memory Usage: 267kB
|
|---|
| 27 | Buffers: shared hit=1034
|
|---|
| 28 | -> Subquery Scan on ps (cost=5076.89..5176.89 rows=4000 width=52) (actual time=70.784..72.327 rows=4000.00 loops=1)
|
|---|
| 29 | Buffers: shared hit=1034
|
|---|
| 30 | -> HashAggregate (cost=5076.89..5136.89 rows=4000 width=52) (actual time=70.783..72.102 rows=4000.00 loops=1)
|
|---|
| 31 | Group Key: es.user_id
|
|---|
| 32 | Batches: 1 Memory Usage: 1169kB
|
|---|
| 33 | Buffers: shared hit=1034
|
|---|
| 34 | -> Hash Join (cost=2140.75..3956.89 rows=56000 width=16) (actual time=15.224..56.130 rows=56000.00 loops=1)
|
|---|
| 35 | Hash Cond: (ss.subjects_id = s.id)
|
|---|
| 36 | Buffers: shared hit=1024
|
|---|
| 37 | -> Hash Join (cost=2131.00..3798.06 rows=56000 width=16) (actual time=15.136..47.841 rows=56000.00 loops=1)
|
|---|
| 38 | Hash Cond: (ss.enrolled_semesters_id = es.id)
|
|---|
| 39 | Buffers: shared hit=1021
|
|---|
| 40 | -> Hash Join (cost=1617.00..3137.01 rows=56000 width=16) (actual time=11.114..34.024 rows=56000.00 loops=1)
|
|---|
| 41 | Hash Cond: (ss.id = ps_1.enrolled_id)
|
|---|
| 42 | Buffers: shared hit=867
|
|---|
| 43 | -> Seq Scan on semesters_subjects ss (cost=0.00..1310.00 rows=80000 width=12) (actual time=0.013..4.720 rows=80000.00 loops=1)
|
|---|
| 44 | Buffers: shared hit=510
|
|---|
| 45 | -> Hash (cost=917.00..917.00 rows=56000 width=12) (actual time=10.920..10.921 rows=56000.00 loops=1)
|
|---|
| 46 | Buckets: 65536 Batches: 1 Memory Usage: 2919kB
|
|---|
| 47 | Buffers: shared hit=357
|
|---|
| 48 | -> Seq Scan on passed_subjects ps_1 (cost=0.00..917.00 rows=56000 width=12) (actual time=0.012..5.112 rows=56000.00 loops=1)
|
|---|
| 49 | Buffers: shared hit=357
|
|---|
| 50 | -> Hash (cost=314.00..314.00 rows=16000 width=8) (actual time=3.863..3.868 rows=16000.00 loops=1)
|
|---|
| 51 | Buckets: 16384 Batches: 1 Memory Usage: 753kB
|
|---|
| 52 | Buffers: shared hit=154
|
|---|
| 53 | -> Seq Scan on enrolled_semesters es (cost=0.00..314.00 rows=16000 width=8) (actual time=0.044..1.950 rows=16000.00 loops=1)
|
|---|
| 54 | Buffers: shared hit=154
|
|---|
| 55 | -> Hash (cost=6.00..6.00 rows=300 width=8) (actual time=0.081..0.081 rows=300.00 loops=1)
|
|---|
| 56 | Buckets: 1024 Batches: 1 Memory Usage: 20kB
|
|---|
| 57 | Buffers: shared hit=3
|
|---|
| 58 | -> Seq Scan on subjects s (cost=0.00..6.00 rows=300 width=8) (actual time=0.011..0.044 rows=300.00 loops=1)
|
|---|
| 59 | Buffers: shared hit=3
|
|---|
| 60 | -> Hash (cost=514.00..514.00 rows=4000 width=20) (actual time=4.346..4.347 rows=4000.00 loops=1)
|
|---|
| 61 | Buckets: 4096 Batches: 1 Memory Usage: 236kB
|
|---|
| 62 | Buffers: shared hit=154
|
|---|
| 63 | -> Subquery Scan on sem (cost=434.00..514.00 rows=4000 width=20) (actual time=3.189..3.878 rows=4000.00 loops=1)
|
|---|
| 64 | Buffers: shared hit=154
|
|---|
| 65 | -> HashAggregate (cost=434.00..474.00 rows=4000 width=20) (actual time=3.188..3.625 rows=4000.00 loops=1)
|
|---|
| 66 | Group Key: es_1.user_id
|
|---|
| 67 | Batches: 1 Memory Usage: 409kB
|
|---|
| 68 | Buffers: shared hit=154
|
|---|
| 69 | -> Seq Scan on enrolled_semesters es_1 (cost=0.00..314.00 rows=16000 width=16) (actual time=0.025..0.546 rows=16000.00 loops=1)
|
|---|
| 70 | Buffers: shared hit=154
|
|---|
| 71 | -> Hash (cost=3137.36..3137.36 rows=1 width=12) (actual time=61.368..61.370 rows=2000.00 loops=1)
|
|---|
| 72 | Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 102kB
|
|---|
| 73 | Buffers: shared hit=72867
|
|---|
| 74 | -> Subquery Scan on pen (cost=3137.33..3137.36 rows=1 width=12) (actual time=57.936..61.155 rows=2000.00 loops=1)
|
|---|
| 75 | Buffers: shared hit=72867
|
|---|
| 76 | -> GroupAggregate (cost=3137.33..3137.35 rows=1 width=12) (actual time=57.935..61.026 rows=2000.00 loops=1)
|
|---|
| 77 | Group Key: es_2.user_id
|
|---|
| 78 | Buffers: shared hit=72867
|
|---|
| 79 | -> Sort (cost=3137.33..3137.34 rows=1 width=8) (actual time=57.929..58.645 rows=24000.00 loops=1)
|
|---|
| 80 | Sort Key: es_2.user_id
|
|---|
| 81 | Sort Method: quicksort Memory: 1331kB
|
|---|
| 82 | Buffers: shared hit=72867
|
|---|
| 83 | -> Nested Loop (cost=1617.29..3137.32 rows=1 width=8) (actual time=9.638..54.328 rows=24000.00 loops=1)
|
|---|
| 84 | Buffers: shared hit=72867
|
|---|
| 85 | -> Hash Left Join (cost=1617.00..3137.01 rows=1 width=8) (actual time=9.623..26.891 rows=24000.00 loops=1)
|
|---|
| 86 | Hash Cond: (ss_1.id = ps_2.enrolled_id)
|
|---|
| 87 | Filter: (ps_2.id IS NULL)
|
|---|
| 88 | Rows Removed by Filter: 56000
|
|---|
| 89 | Buffers: shared hit=867
|
|---|
| 90 | -> Seq Scan on semesters_subjects ss_1 (cost=0.00..1310.00 rows=80000 width=8) (actual time=0.010..3.379 rows=80000.00 loops=1)
|
|---|
| 91 | Buffers: shared hit=510
|
|---|
| 92 | -> Hash (cost=917.00..917.00 rows=56000 width=8) (actual time=9.527..9.528 rows=56000.00 loops=1)
|
|---|
| 93 | Buckets: 65536 Batches: 1 Memory Usage: 2700kB
|
|---|
| 94 | Buffers: shared hit=357
|
|---|
| 95 | -> Seq Scan on passed_subjects ps_2 (cost=0.00..917.00 rows=56000 width=8) (actual time=0.008..3.817 rows=56000.00 loops=1)
|
|---|
| 96 | Buffers: shared hit=357
|
|---|
| 97 | -> Index Scan using enrolled_semesters_pkey on enrolled_semesters es_2 (cost=0.29..0.31 rows=1 width=8) (actual time=0.001..0.001 rows=1.00 loops=24000)
|
|---|
| 98 | Index Cond: (id = ss_1.enrolled_semesters_id)
|
|---|
| 99 | Index Searches: 24000
|
|---|
| 100 | Buffers: shared hit=72000
|
|---|
| 101 | -> Hash (cost=963.01..963.01 rows=4000 width=12) (actual time=10.082..10.084 rows=4000.00 loops=1)
|
|---|
| 102 | Buckets: 4096 Batches: 1 Memory Usage: 204kB
|
|---|
| 103 | Buffers: shared hit=241
|
|---|
| 104 | -> Subquery Scan on pay (cost=883.01..963.01 rows=4000 width=12) (actual time=8.528..9.462 rows=4000.00 loops=1)
|
|---|
| 105 | Buffers: shared hit=241
|
|---|
| 106 | -> HashAggregate (cost=883.01..923.01 rows=4000 width=12) (actual time=8.527..9.090 rows=4000.00 loops=1)
|
|---|
| 107 | Group Key: es_3.user_id
|
|---|
| 108 | Batches: 1 Memory Usage: 409kB
|
|---|
| 109 | Buffers: shared hit=241
|
|---|
| 110 | -> Hash Join (cost=514.00..803.01 rows=16000 width=8) (actual time=2.543..6.386 rows=16000.00 loops=1)
|
|---|
| 111 | Hash Cond: (p.enrollment_id = es_3.id)
|
|---|
| 112 | Buffers: shared hit=241
|
|---|
| 113 | -> Seq Scan on payment p (cost=0.00..247.00 rows=16000 width=8) (actual time=0.028..0.788 rows=16000.00 loops=1)
|
|---|
| 114 | Buffers: shared hit=87
|
|---|
| 115 | -> Hash (cost=314.00..314.00 rows=16000 width=8) (actual time=2.503..2.503 rows=16000.00 loops=1)
|
|---|
| 116 | Buckets: 16384 Batches: 1 Memory Usage: 753kB
|
|---|
| 117 | Buffers: shared hit=154
|
|---|
| 118 | -> Seq Scan on enrolled_semesters es_3 (cost=0.00..314.00 rows=16000 width=8) (actual time=0.007..1.132 rows=16000.00 loops=1)
|
|---|
| 119 | Buffers: shared hit=154
|
|---|
| 120 | -> Hash (cost=185.24..185.24 rows=4000 width=20) (actual time=3.710..3.712 rows=4000.00 loops=1)
|
|---|
| 121 | Buckets: 4096 Batches: 1 Memory Usage: 236kB
|
|---|
| 122 | Buffers: shared hit=19
|
|---|
| 123 | -> Subquery Scan on doc (cost=105.24..185.24 rows=4000 width=20) (actual time=2.236..3.114 rows=4000.00 loops=1)
|
|---|
| 124 | Buffers: shared hit=19
|
|---|
| 125 | -> HashAggregate (cost=105.24..145.24 rows=4000 width=20) (actual time=2.235..2.795 rows=4000.00 loops=1)
|
|---|
| 126 | Group Key: ud.user_id
|
|---|
| 127 | Batches: 1 Memory Usage: 409kB
|
|---|
| 128 | Buffers: shared hit=19
|
|---|
| 129 | -> Hash Join (cost=1.18..75.24 rows=4000 width=12) (actual time=0.219..1.218 rows=4000.00 loops=1)
|
|---|
| 130 | Hash Cond: (ud.document_id = d.id)
|
|---|
| 131 | Buffers: shared hit=19
|
|---|
| 132 | -> Seq Scan on user_documents ud (cost=0.00..58.00 rows=4000 width=8) (actual time=0.071..0.301 rows=4000.00 loops=1)
|
|---|
| 133 | Buffers: shared hit=18
|
|---|
| 134 | -> Hash (cost=1.08..1.08 rows=8 width=8) (actual time=0.042..0.043 rows=8.00 loops=1)
|
|---|
| 135 | Buckets: 1024 Batches: 1 Memory Usage: 9kB
|
|---|
| 136 | Buffers: shared hit=1
|
|---|
| 137 | -> Seq Scan on documents d (cost=0.00..1.08 rows=8 width=8) (actual time=0.034..0.035 rows=8.00 loops=1)
|
|---|
| 138 | Buffers: shared hit=1
|
|---|
| 139 | Planning:
|
|---|
| 140 | Buffers: shared hit=550 read=8
|
|---|
| 141 | Planning Time: 21.114 ms
|
|---|
| 142 | Execution Time: 179.370 ms
|
|---|
| 143 | -- OK explain_rep_student_dossier.sql
|
|---|