-
Type:
Task
-
Resolution: Won't Fix
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 2.2
-
Component/s: Query Operations
-
None
-
Environment:rails, mongoid, kaminari
mongo (1.6.0)
mongoid (2.4.5)
-
None
-
None
-
None
-
None
-
None
-
None
-
None
running this query (rails console)
irb(main):005:0> Company.where().order([:updated_at, :desc]).page(2350).per(100)
=> #<Mongoid::Criteria
selector: {},
options: {:sort=>[[:updated_at, :desc]], :limit=>100, :skip=>234900},
class: Company,
embedded: false>
i get this op in the log:
PRIMARY> db.currentOp()
{
"inprog" : [
{
"opid" : 452130769,
"active" : true,
"lockType" : "read",
"waitingForLock" : false,
"secs_running" : 5,
"op" : "query",
"ns" : "syn_production.contacts",
"query" : {
"$query" : {
"_type" :
},
"$orderby" :
},
"client" : "10.32.2.108:34235",
"desc" : "conn",
"threadId" : "0x453ac940",
"connectionId" : 20536186,
"numYields" : 0
}
]
}
also, it's not using this index:
PRIMARY> db.contacts.getIndexes()
[
....,
{
"v" : 1,
"key" :
,
"ns" : "syn_production.contacts",
"name" : "updated_at_-1"
}
]
any pointers would be great