You can't and shouldn't put an index on the system.namespaces collection. It's not allowed - just try it in the shell and you will be rejected
> db.system.namespaces. ensureIndex({"name" : 1})
{
"ok" : 0,
"errmsg" : "cannot write to 'test.system.namespaces'",
"code" : 2
}
The collection should only be read by clients (and even then, it's internal, so you shouldn't count on the format remaining the same over time). Where is your evidence of long system.namespace table scans coming from? I don't think you should see namespace lookups logged as normal queries. What driver/framework are you using? Some versions of ORM's do a lot of table scans of the system.namespaces collection, for some reason.
I see alot of this in my mongod logs
{
"ok" : 0,
"errmsg" : "cannot write to 'test.system.namespaces'",
"code" : 2
}
The collection should only be read by clients (and even then, it's internal, so you shouldn't count on the format remaining the same over time). Where is your evidence of long system.namespace table scans coming from? I don't think you should see namespace lookups logged as normal queries. What driver/framework are you using? Some versions of ORM's do a lot of table scans of the system.namespaces collection, for some reason.
I see alot of this in my mongod logs
Wed Oct 29 12:31:29.435 [conn39922484] query discovery_data.system. namespaces query: { name: "discovery_data.blah_blahblah" } ntoreturn:0 ntoskip:0 nscanned:32212 keyUpdates:0 numYields: 251 locks(micros) r:5113487 nreturned:1 reslen:129 10380ms
As far as drivers and framework, its a nodejs app and that's about all I know,I'm not one of the devs, i'm just the guy trying to keep this pos from imploding on its self like a neutron star
댓글 없음:
댓글 쓰기