[eluser]TheJim[/eluser]
I would say for your circumstances, what you're thinking is probably the right way to go about it. I'd maybe test it against the simple looping and querying method since it's easy to code, but with that many additional queries, I think you're almost guaranteed to be much faster with the extra logic.