Page MenuHomePhabricator

API performance issues
Closed, ResolvedPublic

Description

Some queries seem to go very slow or consistently die, these needs some checks to bail of large filesorts and such with row estimates, whereas some may just need to be removed. We should look for more problem queries, but the ones I noticed are:
-Query deleted revs by namespace sorted by timestamp: this degenerates into an 8+ million row quicksort for drnamespace=0. Needs to be removed
-ucprefix: this can really slow down sometimes. A row estimate that reads of the index should be done before scanning. If there are too many, it give a nice error message and bail out. This can be done just like how checkuser does it.


Version: 1.13.x
Severity: major

Details

Reference
bz13511

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:05 PM
bzimport set Reference to bz13511.

(In reply to comment #0)

-Query deleted revs by namespace sorted by timestamp: this degenerates into an
8+ million row quicksort for drnamespace=0. Needs to be removed

Done in r32466

-ucprefix: this can really slow down sometimes. A row estimate that reads of
the index should be done before scanning. If there are too many, it give a nice
error message and bail out. This can be done just like how checkuser does it.

I discovered a filesort in the usercontribs query and killed it, which made the query so efficient it doesn't need this row limiting thing (I'll just trust Domas and Simetrical on that). I implemented generic support for such a check, though, should we ever need it.