Thread:Project:Support desk/Special:ListFiles too large; results in timeout... narrow results?/reply

Quantity of uploaded files shouldn't be the problem, otherwise commons:Special:ListFiles would be broken as well ;)

If that's a SQL problem, you can look at the SQL queries MediaWiki is doing and try to execute them from outside MediaWiki, to see which ones are taking longer to execute.

You can enable profiling for that. See Manual:Profiling. And also see SQL queries setting a debug log as explained in Manual:How to debug and enabling Manual:$wgDebugDumpSql.

Maybe you need to rebuild indexes in your database, or check that indexes exists for those tables.