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

Optimize getTimeseriesBucketsMayHaveMixedSchemaData to parse the storage engine option only once

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: 6.0.0, 7.0.0, 7.3.0, 8.1.0-rc0, 8.0.0-rc16
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v8.0, v7.3, v7.0, v6.0
    • CAR Team 2024-08-19
    • 0

      Context:

      Our performance test showed that SERVER-91195  is causing a regression of 15%.

      After an investigation, we have concluded that the changes for  getTimeseriesBucketsMayHaveMixedSchemaData are responsible for the regression. The method runs for every time-series CRUD operations, and it had been changed in SERVER-91195 to get the value from a flag set in the storageEngine bson object at every iteration, instead of returning the cached in memory value that could be eventually wrong.

      Our local benchmark showed the old implementation was around ~200x times faster. The new implementation relies on parsing a bson field, which can be quite slow compared to simply returning a cached value.

      Solution:

      The parsing of the document could be done only once in the constructor of CollectionImpl and then cached as before. This should both fix SERVER-91195 and revert the regression.

            Assignee:
            enrico.golfieri@mongodb.com Enrico Golfieri
            Reporter:
            enrico.golfieri@mongodb.com Enrico Golfieri
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: