Skip to content

DOCS-1101 BinData index storage #756

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

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 3 additions & 2 deletions source/applications/optimization.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ order, the direction of a single-key index does not matter.

Indexes support queries, update operations, and some phases of the
:ref:`aggregation pipeline
<aggregation-pipeline-operators-and-performance>` for more
information.
<aggregation-pipeline-operators-and-performance>`.

.. include:: /includes/fact-bindata-storage-optimization.rst

Limit Results
~~~~~~~~~~~~~
Expand Down
9 changes: 5 additions & 4 deletions source/core/document.txt
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,11 @@ Consider the following options for the value of an ``_id`` field:
:doc:`/tutorial/create-an-auto-incrementing-field` tutorial for an
implementation pattern.

- Generate a UUID in your application code. For efficiency, store
the UUID as a value of the BSON ``BinData`` type to reduce the
size of UUID values as stored in the collection and in the ``_id``
index.
- Generate a UUID in your application code. For a more efficient
storage of the UUID values in the collection and in the ``_id``
index, store the UUID as a value of the BSON ``BinData`` type.

.. include:: /includes/fact-bindata-storage-optimization.rst

- Use your driver's BSON UUID facility to generate UUIDs. Be aware
that driver implementations may implement UUID serialization and
Expand Down
7 changes: 7 additions & 0 deletions source/includes/fact-bindata-storage-optimization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Index keys that are of the ``BinData`` type are more efficiently stored
in the index if:

- the binary subtype value is in the range of 0-7 or 128-135, and

- the length of the byte array is: 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12,
14, 16, 20, 24, or 32.