summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_knobs.idl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/query_knobs.idl')
-rw-r--r--src/mongo/db/query/query_knobs.idl19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mongo/db/query/query_knobs.idl b/src/mongo/db/query/query_knobs.idl
index fcf9b9e5c86..dc30b285ebb 100644
--- a/src/mongo/db/query/query_knobs.idl
+++ b/src/mongo/db/query/query_knobs.idl
@@ -135,6 +135,25 @@ server_parameters:
validator:
gte: 0
+ internalQueryEnumerationPreferLockstepOrEnumeration:
+ description: "If set to true, instructs the plan enumerator to enumerate contained $ors in a
+ special order. $or enumeration can generate an exponential number of plans, and is therefore
+ limited at some arbitrary cutoff controlled by a parameter. When this limit is hit, the order of
+ enumeration is important. For example, a query like the following has a 'contained $or' (within
+ an $and): {a: 1, $or: [{b: 1, c: 1}, {b: 2, c: 2}]} For this query if there are indexes
+ a_b={a: 1, b: 1} and a_c={a: 1, c: 1}, the normal enumeration order would output assignments
+ [a_b, a_b], [a_c, a_b], [a_b, a_c], then [a_c, a_c]. This flag will instruct the enumerator to
+ instead prefer a different order. It's hard to summarize, but perhaps the phrases 'lockstep
+ enumeration', 'simultaneous advancement', or 'parallel iteration' will help the reader. The
+ effect is to give earlier enumeration to plans which use the same choice across all branches. In
+ this order, we would get assignments [a_b, a_b], [a_c, a_c], [a_c, a_b], then [a_b, a_c]. This
+ is thought to be helpful in general, but particularly in cases where all children of the $or use
+ the same fields and have the same indexes available, as in this example."
+ set_at: [ startup, runtime ]
+ cpp_varname: "internalQueryEnumerationPreferLockstepOrEnumeration"
+ cpp_vartype: AtomicWord<bool>
+ default: false
+
internalQueryEnumerationMaxOrSolutions:
description: "How many solutions will the enumerator consider at each OR?"
set_at: [ startup, runtime ]