I design a data model like this

there a users collection that has one field store array of order ids.
When I want information about all orders of that specific user, I use these ids to get data from collection orders. by using whereIn
List<String> orderIds = (await FirebaseFirestore.instance
.collection('')
.doc(QnRWjhJbjViKUEVBvRAr)
.get()).get('orders');
var result = FirebaseFirestore.instance
.collection('orders')
.where(FieldPath.documentId, whereIn: orderIds)
.get();
I just curious. Is whereIn effiecient? Does it check every single document in orders and test if that id is in orderIds? If that true, when there're more data (let say millions) doesn't this will have performance issue?