M101P: MongoDB for Developers - Chapter 4: Performance

原创 2016年08月29日 19:43:45

Homework 4.1

  • (OK) db.products.find( { $and : [ { price : { $gt : 30 } }, { price : { $lt : 50 } } ] } ).sort( { brand : 1 } )
  • db.products.find( { 'brand' : "GE" } )
  • db.products.find( { brand : 'GE' } ).sort( { category : 1, brand : -1 } )
  • (OK) db.products.find( { 'brand' : "GE" } ).sort( { price : 1 } )

Homework 4.2

  • (OK) The query uses an index to determine the order in which to return result documents.
  • The query uses an index to determine which documents match.
  • (OK) The query examines 251120 documents.
  • The query returns 251120 documents.
  • The query is a covered query.

Homework 4.3

db.posts.createIndex({date:-1})
db.posts.createIndex({tags:1,date:-1})
db.posts.createIndex({permalink:1})

Homework 4.4

> db.profile.find().sort({millis:-1}).limit(1).pretty()
{
        "_id" : ObjectId("57c41c92adaa1d1ee896b853"),
        "ts" : ISODate("2012-11-20T20:09:49.862Z"),
        "op" : "query",
        "ns" : "school2.students",
        "query" : {
            "student_id" : 80
        },
        "ntoreturn" : 0,
        "ntoskip" : 0,
        "nscanned" : 10000000,
        "keyUpdates" : 0,
        "numYield" : 5,
        "lockStats" : {
            "timeLockedMicros" : {
                "r" : 19776550,
                "w" : 0
            },
            "timeAcquiringMicros" : {
                "r" : 4134067,
                "w" : 5
            }
        },
        "nreturned" : 10,
        "responseLength" : 2350,
        "millis" : 15820,
        "client" : "127.0.0.1",
        "user" : ""
}

15820

-eof-

M101P: MongoDB for Developers - Chapter 2: CRUD

M101P: MongoDB for Developers - Chapter 2: CRUD

M101P: MongoDB for Developers - Chapter 3: Schema Design

M101P: MongoDB for Developers - Chapter 3: Schema Design

M102: MongoDB for DBAs - Chapter 4: Replication

M102: MongoDB for DBAs - Chapter 4: Replication

WCF 4 Step By Step Chapter13 Note (Implementing a WCF Service for Good Performance)

Implementing a WCF Service for Good Performance In this chapter, you will examine how to use servic...

M202: MongoDB Advanced Deployment and Operations - Chapter 4: Sharded Cluster Management

M202: MongoDB Advanced Deployment and Operations - Chapter 4: Sharded Cluster Management

iPad for iPhone Developers 101 in iOS 6: UISplitView Tutorial

跟隨本文,你將使用三種最常用的基本功能從頭至尾做一個iPad應用。首先,應用會以split view的方式顯示來自於one of Ray’s Cocos2D games 的一列表怪物。然後你可以使用p...

SQL Tips for Developers: Performance Improvements with the APPEND hint

In all PeopleSoft products, it is common to find batch programs populating large working storage or ...

50.Tips.and.Tricks.for.MongoDB.Developers

这些mongoDB tips全部来源于:50.Tips.and.Tricks.for.MongoDB.Developers 有兴趣可以读读这本书。 MongoDB tips#7: Pre-popula...
  • macyang
  • macyang
  • 2011年06月19日 19:03
  • 795

50.Tips.and.Tricks.for.MongoDB.Developers --- Optimization Tips

下面这些tips总结全部来自“50.Tips.and.Tricks.for.MongoDB.Developers ”,有兴趣可以阅读以下。Tip #21: Minimize disk access这个...
  • macyang
  • macyang
  • 2011年07月11日 21:17
  • 673
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:M101P: MongoDB for Developers - Chapter 4: Performance
举报原因:
原因补充:

(最多只允许输入30个字)