[eluser]fesweb[/eluser]
danoph,
I found that "don't use IN" bit here. I should have also mentioned this line: "Don't use DISTINCT when you have or could use GROUP BY "
Sorry I can't be more help. In the long run, I think you'll have to end up doing some sort of caching.