@@ -29,7 +29,7 @@ understanding of:
2929
3030The best overall strategy for designing indexes is to profile a variety
3131of index configurations with data sets similar to the ones you'll be
32- running in production and to see which configurations perform best.
32+ running in production to see which configurations perform best.
3333
3434MongoDB can only use *one* index to support any given
3535operation. However, each clause of an :operator:`$or` query can use
@@ -41,14 +41,14 @@ Create Indexes to Support Your Queries
4141--------------------------------------
4242
4343If you only ever query on a single key in a given collection, then you need
44- create just one single-key index for that collection. For example, you
44+ to create just one single-key index for that collection. For example, you
4545might create an index on ``category`` in the ``product`` collection:
4646
4747.. code-block:: javascript
4848
4949 db.products.ensureIndex( { "category": 1 } )
5050
51- However, if you sometimes query on only one key but and at other times
51+ However, if you sometimes query on only one key and at other times
5252query on that key combined with a second key, then creating a
5353:ref:`compound index <index-type-compound>` is more efficient. MongoDB
5454will use the compound index for both queries. For example, you might
@@ -122,9 +122,9 @@ part of an index. They are "covered queries" because an index "covers" the query
122122MongoDB can fulfill the query by using *only* the index. MongoDB need
123123not scan documents from the database.
124124
125- Querying *only* the index is much faster than querying documents.
126- Indexes keys are typically smaller than the documents they catalog, and indexes are
127- typically stored in RAM or located sequentially on disk.
125+ Querying *only* the index is much faster than querying documents. Index
126+ keys are typically smaller than the documents they catalog, and indexes
127+ are typically stored in RAM or located sequentially on disk.
128128
129129Mongod automatically uses a covered query when possible. To ensure use
130130of a covered query, create an index that includes all the fields listed
@@ -135,7 +135,7 @@ explicitly exclude the ``_id`` field from the result set, unless the
135135index includes ``_id``.
136136
137137MongoDB cannot use a covered query if any of the indexed fields in any
138- of the documents in the collection include an array. If an indexed field
138+ of the documents in the collection includes an array. If an indexed field
139139is an array, the index becomes a :ref:`multi-key index
140140<index-type-multikey>` index and cannot support a covered query.
141141
@@ -197,10 +197,10 @@ are equality matches.
197197
198198.. note::
199199
200- When the :method:`sort() <cursor.sort()>` method performs an
201- in-memory sort operation without the use of an index, the operation
202- is significantly slower than for operations that use an index, and
203- the operation aborts when it consumes 32 megabytes of memory.
200+ For in-memory sorts that do not use an index, the :method:`sort()
201+ <cursor. sort()>` operation is significantly slower. The
202+ :method:`~cursor.sort()` operation will abort when it uses 32
203+ megabytes of memory.
204204
205205.. _indexes-ensure-indexes-fit-ram:
206206
@@ -226,7 +226,7 @@ available but also must have RAM available for the rest of the
226226
227227If you have and use multiple collections, you must consider the size
228228of all indexes on all collections. The indexes and the working set must be able to
229- fit RAM at the same time.
229+ fit in RAM at the same time.
230230
231231There are some limited cases where indexes do not need
232232to fit in RAM. See :ref:`indexing-right-handed`.
@@ -337,8 +337,8 @@ Consider Performance when Creating Indexes for Write-heavy Applications
337337If your application is write-heavy, then be careful when creating new
338338indexes, since each additional index with impose a
339339write-performance penalty. In general, don't be careless about adding
340- indexes. Add indexes complement your queries. Always have
341- a good reason for adding a new index, and make sure you've benchmarked
340+ indexes. Add indexes to complement your queries. Always have
341+ a good reason for adding a new index, and be sure to benchmark
342342alternative strategies.
343343
344344Consider Insert Throughput
@@ -347,17 +347,16 @@ Consider Insert Throughput
347347.. todo:: insert link to /source/core/write-operations when that page is complete.
348348 Do we want to link to write concern? -bg
349349
350- MongoDB must update *all* indexes associated with a collection after every
351- insert, update, or delete operation. For update operations, if the updated document
352- does not move to a new location, then only the modified, MongoDB only needs
353- to update the updated fields in the index.
354- Therefore, every index on a
355- collection adds some amount of overhead to these write operations. In almost
356- every case, the performance gains that indexes realize for read
350+ MongoDB must update *all* indexes associated with a collection after
351+ every insert, update, or delete operation. For update operations, if
352+ the updated document does not move to a new location, then MongoDB only
353+ modifies the updated fields in the index. Therefore, every index on a
354+ collection adds some amount of overhead to these write operations. In
355+ almost every case, the performance gains that indexes realize for read
357356operations are worth the insertion penalty. However, in some cases:
358357
359358- An index to support an infrequent query might incur more
360- insert-related costs than saved read-time.
359+ insert-related costs than savings in read-time.
361360
362361 .. todo:: How do you determine if the above is the case?
363362 Empirically.
@@ -371,5 +370,5 @@ operations are worth the insertion penalty. However, in some cases:
371370
372371- If your indexes and queries are not sufficiently :ref:`selective
373372 <index-selectivity>`, the speed improvements for query operations
374- might not offset the costs of maintaining an index. For more
373+ may not offset the costs of maintaining an index. For more
375374 information see :ref:`index-selectivity`.
0 commit comments