Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-8663

Slow performance on duplicate key exception

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: Performance
    • Labels:
      None

      Description

      While doing testing with C++ driver, I noticed that when all
      keys were duplicates the performance was way slower.
      Doesnt make sense since it's not supposed to do work in that case...

      I tried with the very simple loop in js, and gives even worse result:

      var start = new Date();
      for (var count = 0; count < 1000000; ++count) {
      db.foo.insert({_id: count});
      }
      print(new Date() - start);

      Collection is empty:
      antoine@ag410:~/Downloads/mongodb-linux-x86_64-2.2.2$ ./bin/mongo
      ~/adobe/testwrites.js
      MongoDB shell version: 2.2.2
      connecting to: test
      12527

      2nd run without dropping:
      antoine@ag410:~/Downloads/mongodb-linux-x86_64-2.2.2$ ./bin/mongo
      ~/adobe/testwrites.js
      MongoDB shell version: 2.2.2
      connecting to: test
      78153

      this is reproducible always..

        Attachments

        1. dups.pdf
          17 kB
        2. stacks.txt
          24 kB

          Activity

            People

            Assignee:
            redbeard0531 Mathias Stearn
            Reporter:
            antoine Antoine Girbal
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: