Skip to content

Commit 5f10a39

Browse files
author
Sam Kleinman
committed
DOCS-219 indexing stubs and organization
1 parent a0568b7 commit 5f10a39

File tree

3 files changed

+153
-5
lines changed

3 files changed

+153
-5
lines changed

draft/administration/indexing.txt

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
===================
2+
Indexing Operations
3+
===================
4+
5+
.. default-domain:: mongodb
6+
7+
Synopsis
8+
--------
9+
10+
Indexes allow MongoDB to and fulfill queries very efficiently, by
11+
creating an small and efficient representation of the documents in the
12+
collection. Fundamentally, indexes in MongoDB operate in a similar
13+
manner to indexes in other database systems. Read the
14+
":doc:`/core/indexes`" documentation for more information on the
15+
fundamentals of indexing in MongoDB, and the
16+
":doc:`/applications/indexes`" documentation for practical strategies
17+
and examples for using indexes in your application.
18+
19+
This document, by contrast provides operational guidelines and
20+
procedures related to indexing data in MongoDB collections.
21+
22+
Operations
23+
----------
24+
25+
Creating Indexes
26+
~~~~~~~~~~~~~~~~
27+
28+
:func:`db.collection.ensureIndex()`
29+
30+
Dropping Indexes
31+
~~~~~~~~~~~~~~~~
32+
33+
:func:`db.collection.dropIndex()`
34+
35+
:func:`db.collection.dropIndexes()`
36+
37+
:dbcommand:`deleteIndexes`
38+
39+
Rebuilding Indexes
40+
~~~~~~~~~~~~~~~~~~
41+
42+
:func:`db.collection.reIndex()`
43+
:dbcommand:`reIndex`
44+
45+
Background Index Creation
46+
~~~~~~~~~~~~~~~~~~~~~~~~~
47+
48+
Rebuilding Indexes in Replica Sets
49+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50+
51+
In Version 1.8 and 2.0
52+
``````````````````````
53+
54+
.. rebuild indexes on secondaries and cycle so that there's never a
55+
failover.
56+
57+
In Version 2.2
58+
``````````````
59+
60+
.. index rebuilds on secondaries are actually background tasks.
61+
62+
Measuring Index Utilization
63+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
64+
65+
.. explain, hint, etc.

draft/applications/indexes.txt

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
=============
2+
Using Indexes
3+
=============
4+
5+
.. default-domain:: mongodb
6+
7+
Synopsis
8+
--------
9+
10+
MongoDB supports :doc:`indexes </core/indexes>` that allow the
11+
database to return results quickly while requiring that the database
12+
scan a minimal number of documents. This can reduce disk access, and
13+
help maintain more even performance in general. See the
14+
":doc:`/core/indexes`" document for more information on the types of
15+
indexes supported by MongoDB and a general background on the index
16+
functionality. Also consider the ":doc:`/administration/indexing`"
17+
document for an introduction to index related operations.
18+
19+
This document provides an overview of the approaches to indexing and
20+
the strategies that you can use as you develop applications with
21+
MongoDB.
22+
23+
Strategies
24+
----------
25+
26+
Use Covered Queries
27+
~~~~~~~~~~~~~~~~~~~
28+
29+
Sort Using Indexes
30+
~~~~~~~~~~~~~~~~~~
31+
32+
Store Indexes in RAM
33+
~~~~~~~~~~~~~~~~~~~~
34+
35+
.. check the size of the index in ram.
36+
37+
consider the size of the working set.
38+
39+
Considerations
40+
--------------
41+
42+
Selectivity
43+
~~~~~~~~~~~
44+
45+
.. ensure the index is selective enough to be able to constrain the
46+
match productively.
47+
48+
Insert Throughput
49+
~~~~~~~~~~~~~~~~~
50+
51+
.. inserts
52+
53+
Storage
54+
~~~~~~~
55+
56+
.. considerations include:
57+
- size of the index
58+
- left/right hand hotness
59+
- DOCS-224
60+
61+
System
62+
~~~~~~
63+
64+
.. considerations include:
65+
- number of indexs
66+
- indexed key limitations
67+
- one query per index.

draft/core/indexes.txt

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ Synopsis
1010
Indexes are an internal representation of the documents in your
1111
database organized so that MongoDB can use them to quickly locate
1212
documents and fulfill queries very efficiently. Fundamentally, indexes
13-
in MongoDB are similar to indexes, MongoDB supports indexes on any
14-
field or sub-field contained in documents within a MongoDB
15-
collection. Consider the following core features of indexes:
13+
in MongoDB are similar to indexes in other database systems. MongoDB
14+
supports indexes on any field or sub-field contained in documents
15+
within a MongoDB collection. Consider the following core features of
16+
indexes:
1617

1718
- MongoDB defines indexes on a per-collection level.
1819

@@ -364,9 +365,24 @@ indexes to fulfill arbitrary queries.
364365
Geospatial Indexes
365366
~~~~~~~~~~~~~~~~~~
366367

368+
.. a brief overview of geo-spatial indexes ~200 words. There should be
369+
a more full "/applications/geospatial-indexes" page. That's also
370+
(potentially) part of DOCS-219, or we could decide to track this
371+
aspect of the documentation separately.
372+
367373
Index Limitations
368374
-----------------
369375

370-
- Number of indexes.
376+
..
377+
Links to limits sections.
378+
379+
- Maximum number of indexes.
380+
381+
- You must have an _id index (except capped collections, unless you
382+
replicate the capped collection.)
383+
384+
- Length of index keys.
385+
386+
- Impact on insert speed.
371387

372-
- Length of index keys.
388+
A minor note about effectiveness of the index relative to its cost.

0 commit comments

Comments
 (0)