reduce number of db roundtrips by querying all child ids in one go