In my rails app I’m using mongoid and in the logs before pretty much every query, even on the same request, it also does
MONGODB dbname['system.namespaces'].find({})
What is this doing? Is this a performance concern? Can I somehow cache so it doesn’t have to do this all the time or at least stop it from clogging up the logs?
Edit: Here’s the relevant portion of the log
Processing by FilesController#new as HTML
Started GET "/" for 127.0.0.1 at Fri Sep 09 15:59:43 -0700 2011
[Barista] Compiling all scripts for barista
[Barista] Compiling all coffeescripts
[Barista] Copying all javascripts
MONGODB db['system.namespaces'].find({})
MONGODB db['users'].find({:_id=>BSON::ObjectId('4e6a949935d3e9726b000001')})
MONGODB db['system.namespaces'].find({})
MONGODB db['files'].find({:token=>"nonssb38"})
This happens in Mongoid until 3.0 comes up. Notice that this only happens in development mode, so it’s not much of a big deal.
References: