我的查询需要〜3秒来执行 $ group 阶段,如何更快?
My query is:
db.getCollection('employee_data').aggregate([
{ $match: //Filter
},
{
$group:
{
_id: {
employee_id:"$employee_id",
activity_date:"$activity_date"
},
trips: { $sum: 1 }
}
}
])
Data size : 4M records