Commit 52877f8
models: optimize with_tag_counts using case-when
Leverage PatchTag index replacing the subquery counter with a JOIN.
The current code is too slow on MySQL, as it doesn't use indexes.
The new approach is more direct and allows proper index usage.
Signed-off-by: Tales da Aparecida <tales.aparecida@redhat.com>1 parent 035ef32 commit 52877f8
1 file changed
Lines changed: 15 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
312 | 311 | | |
313 | 312 | | |
314 | 313 | | |
315 | | - | |
316 | | - | |
317 | 314 | | |
318 | 315 | | |
319 | 316 | | |
320 | 317 | | |
321 | 318 | | |
322 | 319 | | |
323 | 320 | | |
| 321 | + | |
324 | 322 | | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
330 | 336 | | |
331 | | - | |
332 | 337 | | |
333 | | - | |
| 338 | + | |
334 | 339 | | |
335 | 340 | | |
336 | 341 | | |
| |||
0 commit comments