Fix logical bug caused by fuzzy comparators in cardinality estimation of $skip nodes

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.0.0-rc0, 8.3.2
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • v8.3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We're doing a fuzzy <= comparison here before we subtract two values (<= operator implementation is here). If they are fuzzily but not exactly equal, subtraction can produce a negative value (depending on which is greater) and triggers the tassert in assertValid() in the subtraction operator. Use < instead of <= to avoid this issue.

      The same issue exists in `computeAndSetNodeCost()` in cost_estimator.cpp, where using std::min results in use of the same fuzzy comparators. The toDouble() values should be used instead of comparing the CardinalityEstimate objects here to ensure that an exact comparison is used.

      Both of these fixes are necessary to resolve AF-16798.

            Assignee:
            Natalie Hill
            Reporter:
            Natalie Hill
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: