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

Replace anchored regex with string comparison in change stream pipeline

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Query Execution

      Replacing anchored regex ("^string$") with string comparison in the change stream pipeline could yield up to a 7% improvement in our change streams.

      However, this approach is not without drawbacks. When we normalize in MatchExpression, predicates are ordered by their type and name, and regex types are evaluated last. Replacing them with string comparison alters this order, which in some cases leads to performance degradation.

      We may need to consider disabling MatchExpression normalization to address this issue.

      See linked ticket (SERVER-96638) comments for details.

            Assignee:
            Unassigned Unassigned
            Reporter:
            sebastien.mendez@mongodb.com Sebastien Mendez
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: