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

TPC-H query 5 executes >2x as slowly

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • QO 2022-04-04, QO 2022-04-18
    • 135

      9d4321 introduces a performance regression in the AverageLatency metric on both the normalized and denormalized TPC-H schema for query 5. Note that AverageLatency measures the total execution time for a single "cold" run of the query on scale 1 of TPC-H.

      The shape of the denormalized query is:

      [$match, $unwind, $match, $unwind, $lookup, $unwind, $group, $project, $sort]

      After diffing, it looks like the part of the pipeline where executionTimeMillisEstimate starts to differ significantly is where the pipeline has a $lookup; that stage and all subsequent stages take more than double the time to execute.

      We see the same thing on the normalized schema, which has a different shape with more nested $lookups:

      [<5x nested $lookups>, $unwind, $group, $project, $sort]

      Attaching explains for commits 76a0ce (commit before regression was introduced) and 76a0ce on both schemas. Note that the same regression happens on a standalone variant where the feature flag is enabled.

      Useful evergreen patches:

        1. denorm_450ef9.json
          36 kB
        2. denorm_76a0ce.json
          36 kB
        3. explain_diff_denorm.png
          explain_diff_denorm.png
          124 kB
        4. norm_450ef9.json
          34 kB
        5. norm_76a0ce.json
          34 kB

            Assignee:
            anton.korshunov@mongodb.com Anton Korshunov
            Reporter:
            alya.berciu@mongodb.com Alya Berciu
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: