| | 23 | }}} |
| | 24 | |
| | 25 | {{{ |
| | 26 | λ_20( |
| | 27 | τ_{usage_count DESC, avg_build_rating DESC}( |
| | 28 | σ_{avg_build_rating ≥ 4.5}( |
| | 29 | γ_{c.type, c.brand, c.name; |
| | 30 | COUNT(bc.component_id)→usage_count, |
| | 31 | AVG(rb.value)→avg_build_rating |
| | 32 | }( |
| | 33 | σ_{b.created_at ≥ CURRENT_DATE - 1 year}( |
| | 34 | (((components c ⋈_{c.id=bc.component_id} build_component bc) |
| | 35 | ⋈_{bc.build_id=b.id} build b) |
| | 36 | ⋈_{b.id=rb.build_id} rating_build rb) |
| | 37 | ) |
| | 38 | ) |
| | 39 | ) |
| | 40 | ) |
| | 41 | ) |
| | 88 | }}} |
| | 89 | |
| | 90 | {{{ |
| | 91 | build_stats = |
| | 92 | γ_{b.id → build_id, b.user_id; |
| | 93 | COUNT_DISTINCT(fb.user_id) → favorites_count, |
| | 94 | AVG(rb.value) → avg_rating |
| | 95 | } ( |
| | 96 | σ_{b.is_approved = TRUE} ( |
| | 97 | (build b |
| | 98 | ⟕_{b.id = fb.build_id} favorite_build fb) |
| | 99 | ⟕_{b.id = rb.build_id} rating_build rb |
| | 100 | ) |
| | 101 | ) |
| | 102 | |
| | 103 | user_stats = |
| | 104 | γ_{user_id; |
| | 105 | COUNT(build_id) → approved_builds_count, |
| | 106 | SUM(favorites_count) → total_favorites_received, |
| | 107 | AVG(avg_rating) → avg_rating_received |
| | 108 | } ( |
| | 109 | build_stats |
| | 110 | ) |
| | 111 | |
| | 112 | λ_10 ( |
| | 113 | τ_{reputation_score DESC} ( |
| | 114 | π_{u.username, |
| | 115 | u.email, |
| | 116 | us.approved_builds_count, |
| | 117 | us.total_favorites_received, |
| | 118 | ROUND(us.avg_rating_received, 2) → avg_rating_received, |
| | 119 | ((us.approved_builds_count * 10) |
| | 120 | + (us.total_favorites_received * 5) |
| | 121 | + (us.avg_rating_received * 20)) → reputation_score |
| | 122 | } ( |
| | 123 | user_stats us ⋈_{u.id = us.user_id} users u |
| | 124 | ) |
| | 125 | ) |
| | 126 | ) |
| | 176 | |
| | 177 | {{{ |
| | 178 | cpu_per_build = |
| | 179 | π_{b.id → build_id, |
| | 180 | c.name → cpu_model, |
| | 181 | cpu.cores, |
| | 182 | cpu.base_clock |
| | 183 | } ( |
| | 184 | σ_{c.type = 'CPU'} ( |
| | 185 | (((build b |
| | 186 | ⋈_{b.id = bc.build_id} build_component bc) |
| | 187 | ⋈_{bc.component_id = c.id} components c) |
| | 188 | ⋈_{c.id = cpu.component_id} cpu) |
| | 189 | ) |
| | 190 | ) |
| | 191 | |
| | 192 | gpu_per_build = |
| | 193 | π_{b.id → build_id, |
| | 194 | c.name → gpu_model, |
| | 195 | gpu.vram |
| | 196 | } ( |
| | 197 | σ_{c.type = 'GPU'} ( |
| | 198 | (((build b |
| | 199 | ⋈_{b.id = bc.build_id} build_component bc) |
| | 200 | ⋈_{bc.component_id = c.id} components c) |
| | 201 | ⋈_{c.id = gpu.component_id} gpu) |
| | 202 | ) |
| | 203 | ) |
| | 204 | |
| | 205 | λ_20 ( |
| | 206 | τ_{price_to_performance_index DESC} ( |
| | 207 | π_{b.name → build_name, |
| | 208 | cpu.cpu_model, |
| | 209 | gpu.gpu_model, |
| | 210 | b.total_price, |
| | 211 | (cpu.cores * cpu.base_clock + gpu.vram * 100) → performance_score, |
| | 212 | ROUND((cpu.cores * cpu.base_clock + gpu.vram * 100), 4) → price_to_performance_index |
| | 213 | } ( |
| | 214 | σ_{b.total_price > 0} ( |
| | 215 | ((build b |
| | 216 | ⋈_{b.id = cpu.build_id} cpu_per_build cpu) |
| | 217 | ⋈_{b.id = gpu.build_id} gpu_per_build gpu) |
| | 218 | ) |
| | 219 | ) |
| | 220 | ) |
| | 221 | ) |
| | 222 | }}} |