Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-307

The low speed of range query with two constraints

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Critical - P2 Critical - P2
    • None
    • 2.5
    • API
    • None
    • network card: 1000Mbit/s, memory 8G, Mongodb 1.8, Mongodb driver 2.5

    Description

      I use single java client to do range query with two constraints and i have create index on query key, the read speed only can reach to 6M/s (Read back 6M, nearly spend 1.1 second ), but my network card is "1000Mbit/s" and all of query data have been in memory(The data size < Memory size)?

      stats info:

      "objects" : 2936299,
      "avgObjSize" : 357.40783210429186,
      "dataSize" : 1049456260,
      "storageSize" : 1181462784,
      "indexSize" : 370705344,
      "fileSize" : 4226809856,

      select report_path from table where visit_time > start_visit_time and visit_time < end_visit_time
      --------------------------------------------------------------------
      BasicDBObject range = new BasicDBObject();
      range.put("$gt", start_visit_time);
      range.put("$lt", end_visit_time);

      BasicDBObject query = new BasicDBObject();
      query.put("visit_time", range);

      BasicDBObject keys = new BasicDBObject();
      keys.put("report_path", 1);
      keys.put("_id", 0);

      DBCursor cur = ct.find(query, keys);
      while (cur.hasNext())

      { String report_path = cur.next().toString(); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            shawny shawn yang
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: