It's better to do a `.filter(id__in=device_ids)` than to query one by one. If you wish to do smaller queries, paginate (e.g. filter on a slice of `device_ids`).