An alternative would be to use a join, but that's going to be even slower. What kind of h/w is the db running on? Is it the same machine I looked at earlier today (it was pretty slow on simple queries)?