-
Type:
Question
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
I'm using the following shard key and document in the collection, sh.status()
1. shard key:
{ "_id": 1 },
{ _id: "AH_25a55ce50b8dce490000000001" }
> using the following shard key and document in the collection, no problem?
2. planSummary: IDHACK:
> it is just informing that mongod has choose to use _id index. right?
no problem?
//sh.status() test.sos shard key: { "_id": 1 } chunks: shard1: 20 shard3: 20 shard2: 20 //document in the collection { _id: "AH_25a55ce50b8dce490000000001" } { _id: "BH_25a55ce50b8dce490000000002" } { _id: "CH_25a55ce50b8dce490000000003" } { _id: "DH_25a55ce50b8dce490000000004" } { _id: "EH_25a55ce50b8dce490000000005" } { _id: "FH_25a55ce50b8dce490000000006" } { _id: "GH_25a55ce50b8dce490000000007" } { _id: "HH_25a55ce50b8dce490000000008" } //mongod.log $query: { _id: "AH_25a55ce50b8dce490000000001" } } planSummary: IDHACK ntoskip:0 nscanned:1 nscannedObjects:1 idhack:1 keyUpdates:0 writeConflicts:0 numYields:0 nreturned:1 reslen:1277 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 1 } }, Collection: { acquireCount: { r: 1 } } } 0ms > IDHACK means that normal query plan path (evaluation, caching, re-evaluation) was bypassed for the query shape {_id: <value>} which is supported by the required _id index. this is a performance optimization for the common use case of fetching a document by primary key.
Thanks,
hyeongwa