Skip to content

DOCS-276- usePowerOf2Sizes #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 6, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .ext/mongodb_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ def run(self):
names=('fields', 'fields', 'field', 'field'),
typerolename=('dbcommand', 'setting', 'status', 'stats', 'aggregator'),
typenames=('fieldtype', 'type')),
TypedField('flags', label=l_('Flags'),
names=('flags', 'flags', 'flag', 'flag'),
typerolename=('dbcommand', 'setting', 'status', 'stats', 'aggregator'),
typenames=('flagtype', 'type')),
GroupedField('errors', label=l_('Throws'), rolename='err',
names=('throws', ),
can_collapse=True),
Expand Down
28 changes: 25 additions & 3 deletions source/reference/collection-statistics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,31 @@ Fields

.. stats:: flags

Indicates the number of flags on the current collection. At the
preset, the only flag notes the existence of an :term:`index` on
the :term:`_id` field.
.. versionchanged:: 2.2
Removed in version 2.2 and replaced with the :stats:`userFlags`
and :stats:`systemFlags` fields.

Indicates the number of flags on the current collection. In version
2.0, the only flag notes the existence of an :term:`index` on the
:term:`_id` field.

.. stats:: systemFlags

.. versionadded:: 2.2

Reports the number of flags on this collection that reflect
internal server activity. Typically this value is ``1`` and
reflects the existence of an :term:`index` on the ``_id`` field.

.. stats:: userFlags

.. versionadded:: 2.2

Reports the total number of flags on this collection that reflect
user actions. In version 2.2 the only user collection flag is
``usePowerOf2Sizes``. See :dbcommand:`collMod`` for more
information on setting user flags and :ref:`usePowerOf2Sizes
<usePowerOf2Sizes>`.

.. stats:: totalIndexSize

Expand Down
31 changes: 31 additions & 0 deletions source/reference/commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,37 @@ Collections
- It is not possible to compact :term:`capped collections <capped
collection>`.

.. dbcommand:: collMod

.. versionadded:: 2.2

:dbcommand:`collMod` makes it possible to add flags to a collection
to modify the behavior of MongoDB. In the current release the only
available flag is ``usePowerof2Sizes``. The command takes the
following prototype form:

.. code-block:: javascript

db.runCommand( {"collMod" : [collection] , "[flag]" : [value]" } )

In this command substitute ``[collection]`` with the name of the
collection, and ``[flag]`` and ``[value]`` with the flag and value
you want to set.

.. index:: usePowerOf2Sizes
.. _usePowerOf2Sizes:

The ``usePowerOf2Sizes`` flag changes the method that MongoDB uses
to allocate space on disk for documents in this collection. By
setting ``usePowerOf2Sizes``, you ensure that MongoDB will
allocates space for documents in sizes that are powers of 2
(e.g. 4, 8, 16, 32, 64, 128, 512...) With this option MongoDB will
be able to more effectively reuse space.

``usePowerOf2Sizes`` is useful for collection where you will be
inserting and deleting large numbers of documents to ensure that
MongoDB will effectively use space on disk.

Administration
~~~~~~~~~~~~~~

Expand Down