categorytree forces scans of millions of rows (for large categories) to return 0 row datasets quite often.
this has been discussed in the past a lot, I'll write it down yet again.
there're few fixes, one is by prefixing cl_sortkey with character not used in category names and filtering by it - would need rewriting sortindex only for subset of rows.
another is creating separate columns, creating or replacing indexes, etc - in categorylinks table
another is maintaining subcategories table per category