Skip to content

Commit

Permalink
DOCS-3699: Warnings around notablescan
Browse files Browse the repository at this point in the history
Signed-off-by: kay <kay.kim@10gen.com>
  • Loading branch information
TimSlavinMongoDB authored and kay-kim committed Aug 28, 2014
1 parent 15c6f09 commit 43a3768
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/includes/options-mongod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ name: notablescan
args: null
directive: option
description: |
Forbids operations that require a table scan.
Forbids operations that require a table scan. See :parameter:`notablescan` for additional information.
optional: true
---
program: mongod
Expand Down
24 changes: 20 additions & 4 deletions source/reference/parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,32 @@ Parameters

.. parameter:: notablescan

Specify whether queries must use indexes. If ``1``, queries that
perform a table scan instead of using an index will fail.
Specify whether **all** queries must use indexes. If ``1``, MongoDB
will not execute queries that require a table scan and will return an
error.

Consider the following example which sets :parameter:`notablescan` to
true:
Consider the following example which sets :parameter:`notablescan` to ``1``
or true:

.. code-block:: javascript

db.getSiblingDB("admin").runCommand( { setParameter: 1, notablescan: 1 } )

Setting :parameter:`notablescan` to ``1`` can be useful for testing
application queries, for example, to identify queries that scan an
entire collection and cannot use an index.

To detect unindexed queries without ``notablescan``, consider reading
the :doc:`/tutorial/evaluate-operation-performance` and
:doc:`/tutorial/optimize-query-performance-with-indexes-and-projections`
sections and using the :parameter:`logLevel` parameter,
:doc:`/reference/program/mongostat` and :ref:`profiling
<database-profiling>`.

Don't run production :program:`mongod` instances with
:parameter:`notablescan` because preventing table scans can potentially
affect queries in all databases, including administrative queries.

.. parameter:: replIndexPrefetch

.. versionadded:: 2.2
Expand Down

0 comments on commit 43a3768

Please sign in to comment.