> If we did user_ids[start:min(start+batch_size, total)] as before, then it would produce a separate query for each batch.

Exactly. It would be simpler and it would put less strain to the database. Do you have any arguments against slicing?