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

Unique index performance degradation after upgrading from 4.4.3 to 5.0.3

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • Hide
      1. create a collection with a unique index
      2. save few hundred documents
      3. deleteMany({})
      4. GOTO 2

      The required time between 2-4 slowly increases with 5.0.3, but stay the same with 4.4.3.

      Show
      create a collection with a unique index save few hundred documents deleteMany({}) GOTO 2 The required time between 2-4 slowly increases with 5.0.3, but stay the same with 4.4.3.
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      The issue is the following:

      I have a testing environment with bunch of integration tests running one after the other. They are using MongoDB, and using the same database and collections.

      I only have some unique indices there and there, there are no regular indices.

      Between fixtures I reset the database just by calling collection.deleteMany({}) in each collection.

      In 4.4.3 it was fine, but after 5.0.3 upgrade I noticed a serious performance degradation. After some investigation, I found that every test case took a slightly more time to run than the previous one, and it slowly added up, and to the end I can see test cases took 2x more time to finish than did with 4.4.3.

      What I ended up with, when I drop and recreate indices between fixtures, I get the same performance as it was with 4.4.3.

      So I suspect that somehow unique indices of deleted entries are not getting deleted automatically causing performance degradation for live data.

            Assignee:
            eric.sedor@mongodb.com Eric Sedor
            Reporter:
            gabor42mezo@gmail.com Gábor Mező
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: