Is $lookup from MongoDB slower than a join in a SQL database, with indexes involve?
db.inventory.aggregate( [ { $lookup: { from: "order", localField: "_id", foreignField: "item_id", as: "inventory_docs" } } ] ) The $lookup is joining based on the item_id field, which is indexed. If 100,000 documents pass through this $lookup, it increased the query…