Commit bc1289c
perf(audio_cli): optimize audio stats queries with unified aggregation
Consolidated three separate full-table scanning SQLite queries (Total Files, Duration Stats, and Recent Activity) in `audio_cli.py` into a single, optimized query using `COALESCE` and conditional aggregation. This eliminates redundant database round-trips and full table scans during CLI reporting.
Co-authored-by: thebearwithabite <216692431+thebearwithabite@users.noreply.github.com>1 parent 613e4ba commit bc1289c
1 file changed
Lines changed: 15 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
207 | | - | |
208 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
209 | 221 | | |
210 | 222 | | |
211 | 223 | | |
| |||
243 | 255 | | |
244 | 256 | | |
245 | 257 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | 258 | | |
257 | 259 | | |
258 | 260 | | |
| |||
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | 280 | | |
285 | 281 | | |
286 | 282 | | |
| |||
0 commit comments