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:
Well its performing an operation on the database so I don't see how its clutter when you have your normal queries in the logs as well. The documentation for MongoDB states that the <dbname>.system.*
namespaces keep database related metadata in them.
You most likely cant cache it since its data that may need to be updated on each query as part of some database housekeeping. I'm looking in the source for some concrete answers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With