Skip to content

Commit 813261f

Browse files
(DOCS-14833): Add parameter to control SBE cache
1 parent 1056556 commit 813261f

File tree

3 files changed

+112
-57
lines changed

3 files changed

+112
-57
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Increasing the plan cache size adds more cached query shapes for the
2+
:ref:`query planner <read-operations-query-optimization>`. This can
3+
improve query performance, but increases memory usage.

source/reference/parameters.txt

Lines changed: 83 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -907,47 +907,6 @@ General Parameters
907907

908908
:parameter:`connPoolMaxShardedConnsPerHost`
909909

910-
.. parameter:: internalQueryEnableSlotBasedExecutionEngine
911-
912-
.. versionadded:: 5.1
913-
914-
*Type*: boolean
915-
916-
*Default*: true
917-
918-
|mongod-only|
919-
920-
If :parameter:`internalQueryEnableSlotBasedExecutionEngine` is
921-
``true``:
922-
923-
- Enhanced query execution is used if possible. If used, the document
924-
structure is separated from the document content, and only the
925-
required fields are used in the engine computations. This improves
926-
performance and ensures database resources are efficiently used.
927-
928-
- If enhanced query execution is used, the query plan :ref:`explain
929-
results <explain-results-enhanced-execution>` have a different
930-
structure and contain additional information about the execution
931-
plan.
932-
933-
If :parameter:`internalQueryEnableSlotBasedExecutionEngine` is
934-
``false``, enhanced query execution is not used.
935-
936-
The following sets
937-
:parameter:`internalQueryEnableSlotBasedExecutionEngine` to
938-
``false``:
939-
940-
.. code-block:: bash
941-
942-
mongod --setParameter internalQueryEnableSlotBasedExecutionEngine=false
943-
944-
You can also use the :dbcommand:`setParameter` command within the
945-
:mongosh:`MongoDB Shell </>`:
946-
947-
.. code-block:: javascript
948-
949-
db.adminCommand( { setParameter: 1, internalQueryEnableSlotBasedExecutionEngine: false } )
950-
951910
.. parameter:: shardedConnPoolIdleTimeoutMinutes
952911

953912
.. versionadded:: 3.6.3
@@ -4230,3 +4189,86 @@ Transaction Parameters
42304189
.. code-block:: javascript
42314190

42324191
db.adminCommand( { setParameter: 1, shouldMultiDocTxnCreateCollectionAndIndexes: false } )
4192+
4193+
Slot-Based Execution Parameters
4194+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4195+
4196+
.. parameter:: internalQueryEnableSlotBasedExecutionEngine
4197+
4198+
.. versionadded:: 5.1
4199+
4200+
*Type*: boolean
4201+
4202+
*Default*: true
4203+
4204+
|mongod-only|
4205+
4206+
If :parameter:`internalQueryEnableSlotBasedExecutionEngine` is
4207+
``true``:
4208+
4209+
- Enhanced query execution is used if possible. If used, the document
4210+
structure is separated from the document content, and only the
4211+
required fields are used in the engine computations. This improves
4212+
performance and ensures database resources are efficiently used.
4213+
4214+
- If enhanced query execution is used, the query plan :ref:`explain
4215+
results <explain-results-enhanced-execution>` have a different
4216+
structure and contain additional information about the execution
4217+
plan.
4218+
4219+
If :parameter:`internalQueryEnableSlotBasedExecutionEngine` is
4220+
``false``, enhanced query execution is not used.
4221+
4222+
The following sets
4223+
:parameter:`internalQueryEnableSlotBasedExecutionEngine` to
4224+
``false``:
4225+
4226+
.. code-block:: bash
4227+
4228+
mongod --setParameter internalQueryEnableSlotBasedExecutionEngine=false
4229+
4230+
You can also use the :dbcommand:`setParameter` command within the
4231+
:mongosh:`MongoDB Shell </>`:
4232+
4233+
.. code-block:: javascript
4234+
4235+
db.adminCommand( { setParameter: 1, internalQueryEnableSlotBasedExecutionEngine: false } )
4236+
4237+
.. parameter:: planCacheSize
4238+
4239+
.. versionadded:: 5.1
4240+
4241+
*Type*: string
4242+
4243+
*Default*: 5%
4244+
4245+
|mongod-only|
4246+
4247+
Sets the size of the :ref:`plan cache
4248+
<read-operations-query-optimization>` for the enhanced query
4249+
execution engine.
4250+
4251+
You can set the :parameter:`planCacheSize` value to either:
4252+
4253+
- A percentage of the system's total physical memory to allocate for
4254+
the plan cache. For example, ``"8.5%"``.
4255+
4256+
- The exact amount of data to allocate for the plan cache in either
4257+
``MB`` or ``GB``. For example, ``"100MB"`` or ``"1GB"``.
4258+
4259+
.. include:: /includes/fact-sbe-plan-cache-motivation.rst
4260+
4261+
The following startup command sets :parameter:`planCacheSize` to 80
4262+
megabytes:
4263+
4264+
.. code-block:: bash
4265+
4266+
mongod --setParameter planCacheSize="80MB"
4267+
4268+
You can also use the :dbcommand:`setParameter` command within the
4269+
:mongosh:`MongoDB Shell </>`:
4270+
4271+
.. code-block:: javascript
4272+
4273+
db.adminCommand( { setParameter: 1, planCacheSize: "80MB" } )
4274+

source/release-notes/5.1.txt

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,32 @@ Starting in MongoDB 5.1, :expression:`$dateSubtract` and
5454
:expression:`$dateAdd` report an error when an overflow is detected for
5555
``amount`` values.
5656

57+
.. _5.1-rel-notes-sbe:
58+
59+
Slot-Based Query Execution Engine
60+
---------------------------------
61+
62+
Starting in MongoDB 5.1, a new query execution engine is available,
63+
which improves query performance.
64+
65+
If the new parameter
66+
:parameter:`internalQueryEnableSlotBasedExecutionEngine` is ``true``:
67+
68+
- The new query execution engine is used if possible.
69+
70+
- If the new query execution engine is used, new fields are included in
71+
the :ref:`query explain plan output
72+
<explain-results-enhanced-execution>`.
73+
74+
Set Slot-Based Query Execution Plan Cache Size
75+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76+
77+
You can set the size of the :ref:`plan cache
78+
<read-operations-query-optimization>` for the new query engine with the
79+
:parameter:`planCacheSize` parameter.
80+
81+
.. include:: /includes/fact-sbe-plan-cache-motivation.rst
82+
5783
.. _5.1-rel-notes-change-streams:
5884

5985
Change Streams
@@ -95,22 +121,6 @@ Aggregation Metrics
95121
Resharding Statistics
96122
- :serverstatus:`shardingStatistics.resharding.lastOpEndingChunkImbalance`
97123

98-
99-
New Slot-Based Query Execution Engine
100-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101-
102-
Starting in MongoDB 5.1, a new query execution engine is available,
103-
which improves query performance.
104-
105-
If the new parameter
106-
:parameter:`internalQueryEnableSlotBasedExecutionEngine` is ``true``:
107-
108-
- The new query execution engine is used if possible.
109-
110-
- If the new query execution engine is used, new fields are included in
111-
the :ref:`query explain plan output
112-
<explain-results-enhanced-execution>`.
113-
114124
Geo Indexing for Time Series collections
115125
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
116126

0 commit comments

Comments
 (0)