[SERVER-4327] allow dummy table scans in no table scan mode Created: 18/Nov/11  Updated: 28/Jan/15  Resolved: 28/Jan/15

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

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: David Storch
Resolution: Incomplete Votes: 1
Labels: query_triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-4317 index not used when argument to $in i... Closed
is related to SERVER-2222 notablescan mode neglects to fail som... Backlog
Operating System: ALL
Participants:

 Description   

Implement what I described here:

        if ( _impossible ) {
            // TODO We might want to allow this dummy table scan even in no table
            // scan mode, since it won't scan anything.
            if ( _frs.nNontrivialRanges() )
                checkTableScanAllowed( _frs.ns() );
            return shared_ptr<Cursor>( new BasicCursor( DiskLoc() ) );
        }

Also audit additional notablescan functionality (see SERVER-2222).



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

The new query system does not have any concept of a "dummy table scan". As far as I can tell, this refers to queries that logically cannot have any matches. The query db.docs.find({arr: {$in: []}}) for example, will always have a result size of 0. The old query system would short-circuit the execution of such queries.

The query system written for 2.6, on the other hand, will always perform a table scan if the query cannot be indexed. Therefore, this ticket is no longer relevant. Closing as Incomplete.

Comment by Aaron Staple [ 07/Mar/13 ]

We should perform the audit in 2.5.x and prioritize any remaining work.

Comment by Aaron Staple [ 19/Jan/12 ]

Still need to audit additional notablescan functionality as mentioned in the description of this ticket.

Comment by auto [ 19/Jan/12 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-4327 comment
Branch: master
https://github.com/mongodb/mongo/commit/b15003971f1957060a6ebf7a34fcb75fd89e6ba8

Comment by auto [ 19/Jan/12 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-4327 allow dummy table scans in notablescan mode
Branch: master
https://github.com/mongodb/mongo/commit/2bd1aeb2996b7cba38218b3daddf04b12245b98d

Comment by Colin Howe [ 19/Nov/11 ]

This would be really good for us. It would stop a query like:

    db.docs.find({arr: {$in: []}})

From raising a table scan exception.

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