[SERVER-19679] Presence of pipe '|' is search causes all keys to be examined Created: 30/Jul/15  Updated: 30/Jul/15  Resolved: 30/Jul/15

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

Type: Bug Priority: Major - P3
Reporter: Steven Hand Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File test_regexp-data.dump    
Issue Links:
Depends
Duplicate
duplicates SERVER-16622 RegEx query predicates using the | (v... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:
  1. setup system with 3.0.4
    1. mongo shell
    2. import enclosed dump file
    3. run "db.re.find({_id:/^\Q1234^mr^sjc|ENT\E/}).explain('executionStats')"
    4. check the "totalKeysExamined" field in output, should be 2 but is 9
    5. run "db.re.find({_id:/^\Q1234^mr^sjc\E/}).explain('executionStats')"
    6. check the "totalKeysExamined" field in output
  2. setup system with 2.6.9
    1. mongo shell
    2. import enclosed dump file
    3. run "db.re.find({_id:/^\Q1234^mr^sjc|ENT\E/}).explain('executionStats')"
    4. check the "nscanned" field in output, should be 2 but is 9
    5. run "db.re.find({_id:/^\Q1234^mr^sjc\E/}).explain('executionStats')"
    6. check the "nscanned" field in output
Participants:

 Description   

There appears to be a regression with how the query processor handles the pipe character '|'. In version 3.0.4, regular queries using the pipe character scan all entries in the index. In version 2.6.9, regular queries using the pipe character DO NOT scan all entries in the index.



 Comments   
Comment by J Rassi [ 30/Jul/15 ]

I can confirm that this ticket is a duplicate of SERVER-16622. Closing this ticket as such.

Comment by Steven Hand [ 30/Jul/15 ]

I get the same results when using the escaped pipe character, e.g. "db.re.find({_id:/^1234^mr^sjc|ENT/}).explain('executionStats')"

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