db.collection.createIndex({field1: 1, field2: -1}); db.collection.find({field1: "value1"}).sort({field2: -1}).explain(); operationProfiling: slowOpThresholdMs: 100 mode: slowOp db.runCommand({setParameter: 1, queryExecutorCacheKeepTime: 10000}); 1. MongoDB Manual - Query Optimization: https://docs.mongodb.com/manual/core/query-optimization/ 2. MongoDB Indexing: https://docs.mongodb.com/manual/indexes/


上一篇:
下一篇:
切换中文