Repository navigation
Commit 8fa5cc0
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 1455a92 commit 8fa5cc0
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 | | |
| |||
308 | 307 | | |
309 | 308 | | |
310 | 309 | | |
311 | | - | |
312 | | - | |
313 | 310 | | |
314 | 311 | | |
315 | 312 | | |
316 | 313 | | |
317 | 314 | | |
318 | 315 | | |
319 | 316 | | |
| 317 | + | |
320 | 318 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
326 | 332 | | |
327 | | - | |
328 | 333 | | |
329 | | - | |
| 334 | + | |
330 | 335 | | |
331 | 336 | | |
332 | 337 | | |
| |||
0 commit comments