[SERVER-2222] notablescan mode neglects to fail some table scan queries Created: 14/Dec/10  Updated: 03/Jan/24

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

Type: Improvement Priority: Major - P3
Reporter: Aaron Staple Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-2291 count command returns zero in some er... Closed
Duplicate
is duplicated by SERVER-3692 --notablescan doesn't prevent scans w... Closed
is duplicated by SERVER-21302 Possible to run COLSCAN with --notabl... Closed
Related
related to SERVER-4327 allow dummy table scans in no table s... Closed
Assigned Teams:
Query Optimization
Participants:

 Description   

These are just the cases I've run into, possibly there are more:

t.find( {} );

  • uses a table scan without generating an exception

t.find( ... );

  • if the table is empty, no table scan exception is generated

t.count(

{a:1}

);

  • seems to return 0 and not raise a js error (though last error appears to be set) - possibly this is just an issue with js count wrapper

Maybe we want to allow some of these cases, but if so we should document that fact.



 Comments   
Comment by Dwight Merriman [ 14/Feb/12 ]

commit 338ef8c94b9677242a52e8855eecbfc449c9da76
Author: dwight <dwight@10gen.com>
Date: Mon Feb 13 21:40:21 2012 -0500

slight improvement in noTableScan code

Comment by Aaron Staple [ 23/Jan/12 ]

An issue with notablescan namespace whitelist matching

        if ( strstr( ns() , ".system." ) ||
            strstr( ns() , "local." ) )
            return;

The pattern matching should be more precise to prevent table scans from sneaking through on namespaces like 'my_local.foo'. Also not clear that all local namespaces should be in the whitelist.

Comment by Colin Howe [ 19/Nov/11 ]

t.find( ... );

if the table is empty, no table scan exception is generated

As a user of the table scan exception functionality my initial thought was that this case is the correct behaviour. However, if there were to be any rows than this would be a table scan. Advance warning of this on an empty table would be useful!

Generated at Thu Feb 08 02:59:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.