[SERVER-40083] Don't recompile each time $regex is evaluated when regex argument is a constant Created: 11/Mar/19  Updated: 29/Oct/23  Resolved: 26/Apr/19

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

Type: Improvement Priority: Major - P3
Reporter: Ian Boros Assignee: Arun Banala
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2019-04-08, Query 2019-04-22, Query 2019-05-06
Participants:

 Description   

This is follow-on work for SERVER-39695.

 

Compiling a regex can be O(2^n) time (n being size of the regex). In most cases, users will probably run the same regex over and over. Recompiling the same regex over and over would be extremely silly, and in some cases may make the $regex operator completely useless.



 Comments   
Comment by Githook User [ 26/Apr/19 ]

Author:

{'email': 'arun.banala@mongodb.com', 'name': 'Arun Banala', 'username': 'banarun'}

Message: SERVER-40083 Don't recompile each time $regex is evaluated when regex argument is a constant
Branch: master
https://github.com/mongodb/mongo/commit/7e700f6668fcbd5b96d46884364f1a7377945abb

Comment by Githook User [ 23/Apr/19 ]

Author:

{'name': 'Ian Boros', 'username': 'puppyofkosh', 'email': 'puppyofkosh@gmail.com'}

Message: Revert "SERVER-40083 Don't recompile each time $regex is evaluated when regex argument is a constant"

This reverts commit a60f6a53734fa3a022e9ba39bbdab95608ba9108.
Branch: master
https://github.com/mongodb/mongo/commit/03a6b3f910e051624dd6b3065b5ee9ea3b6c6fb5

Comment by Githook User [ 23/Apr/19 ]

Author:

{'name': 'Ian Boros', 'username': 'puppyofkosh', 'email': 'puppyofkosh@gmail.com'}

Message: Revert "SERVER-40083 Rename 'pcre' variable to fix compile issue becase of typedef conflict"

This reverts commit 0e367bc76f23d6d876caa00a47700b3634402817.
Branch: master
https://github.com/mongodb/mongo/commit/c3a2176d5124ef3dc160db2b9f85c698e1ca2664

Comment by Githook User [ 23/Apr/19 ]

Author:

{'name': 'Arun Banala', 'username': 'banarun', 'email': 'arun.banala@mongodb.com'}

Message: SERVER-40083 Rename 'pcre' variable to fix compile issue becase of typedef conflict
Branch: master
https://github.com/mongodb/mongo/commit/0e367bc76f23d6d876caa00a47700b3634402817

Comment by Githook User [ 23/Apr/19 ]

Author:

{'email': 'arun.banala@mongodb.com', 'name': 'Arun Banala', 'username': 'banarun'}

Message: SERVER-40083 Don't recompile each time $regex is evaluated when regex argument is a constant
Branch: master
https://github.com/mongodb/mongo/commit/a60f6a53734fa3a022e9ba39bbdab95608ba9108

Generated at Thu Feb 08 04:53:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.