Ah, yes. Then I am the wrong person to answer this question. Can look into it, though.
Is there some way to write it as the outer query, and the name and category as a subquery? Dumb question, I know, because that appears to be what you are doing. Hard to say how you would make that more efficient.
You might have to go searching, or take your question to SO where the pool of expertise is deeper.