in reply to Array vs. Hash

I think you should definitely use a hash in this case. The IDs being not sequential also shouldn't be a problem, you can always sort $keys if the need arises. My vote: hash.