FLE queries with encrypted text predicates fail to generate an index scan

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc1, 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Integration
    • Fully Compatible
    • ALL
    • v8.2
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      During performance testing for the FLE Prefix/suffix/substring initiative https://jira.mongodb.org/browse/SPM-3012 , a critical performance issue was found in the substring use case.

      An initial solution in the query optimizer was provided (see https://jira.mongodb.org/browse/SERVER-107804), which allows the rewriting of $in clauses in a $expr to a match equivalent such that the index scan could be leveraged.

      However, in cases where the number of tags we are searching for is very high (i.e $encStrContains: {input: "$email", substring: "@gma"}, the residual predicate evaluation turns out to be far too slow for the acceptance testing. A performance comparison between a possible solution in the FLE rewrite step when compared to the QO solution showed the performance of the QO rewrite solution was twice as slow as that of the FLE rewrite step.

      As part of this ticket, implement the required logic such that encrypted text search predicates in a $match: {$expr: {}} use the $match expression tag disjunction generation instead of the aggregation path. 

              Assignee:
              Santiago Roche
              Reporter:
              Santiago Roche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: