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

[CQF] Improve Bonsai debug logging when group fails to optimize to distinguish between failure and branch/bound

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Query Optimization

    Description

      When we invoke the optimizer with debugInfo, we print a trace of the groups and properties that we consider during optimization (example here). We often use these options in unit tests to aid in debugging when writing new rewrites.

      When we consider a rewrite, we recursively optimize the children of the plan fragment and print the result of that. In the case that optimizeChildren() returns boost::none, we print "failed optimizing". However, there are two cases in which optimizeChildren() returns boost::none:

      1. We failed to find a plan which implements the given properties.
      2. We prune the search space because of branch & bound. That is, we don't consider implementing all of the children of the plan fragment because the cost of the current plan fragment we have consider is already over the limit.

      When debugging, there is no way to distinguish between these two cases. When authoring new rewrites, it would be very helpful to quickly be able to understand which case we are in.

      The purpose of this ticket is to add logging to be able to distinguish the aforementioned cases.

      Attachments

        Activity

          People

            backlog-query-optimization Backlog - Query Optimization
            ben.shteinfeld@mongodb.com Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: