[SERVER-16884] Regex/index optimization should allow "s" option Created: 15/Jan/15  Updated: 29/Jan/15  Resolved: 29/Jan/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.6.7
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Andre Spiegel Assignee: David Storch
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-9035 Regex "s" option causes mongo to use ... Closed
Related
Participants:

 Description   

The optimization to determine index bounds from a regular expression, which works by checking whether the regex is left-anchored and contains a constant prefix, is not applied when the regex has any option other than "m" or "x" (see index_bounds_builder.cpp).

There is no reason why the optimization shouldn't work for the option "s", which only changes the behavior of the . operator, and . can never be part of the constant prefix anyway.

So the suggestion is to perform the optimization even when "s" is present, just as with "m" and "x".



 Comments   
Comment by David Storch [ 29/Jan/15 ]

Closing as a duplicate of SERVER-9035.

Generated at Thu Feb 08 03:42:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.