Hi,
I have the fallowing model and when this query is executed, it takes 1.1 s.
Other app is using the same database and performs this query with 0.3 s(PHP) .
Don't know what else to do, i've tried to change this query many times and still slow, despite the 200k documents.
help please
class Mention
include MongoMapper::Document
def all (options = {})
mentions = Mention.where({}).sort(:data_captura.desc).paginate(:per_page => 15, :page => 2).all
end
end
Here's the output of the explain method:
=> {"cursor"=>"BasicCursor", "nscanned"=>214618, "nscannedObjects"=>214618, "n"=>15, "scanAndOrder"=>true, "millis"=>557, "indexBounds"=>{}, "allPlans"=>[{"cursor"=>"BasicCursor", "indexBounds"=>{}}], "oldPlan"=>{"cursor"=>"BasicCursor", "indexBounds"=>{}}}