Open
Description
Hey so my recent discovery. Idk if this should be implemented in code somehow...
'x' attribute has index.
Model::find()->sum('x') - 700ms
Model::find()->where(['x' => ['$exists' => true]])->sum('x') - 300ms
sum() is doing aggregate()
"In order for an aggregation pipeline to "use" an index the $match stage must be implemented first."