3. > Power of 2 as Default Allocation Strategy
> Server-side Timeouts
> Query Engine Introspection
> Background Indexing on Secondaries
Here’s what you missed:
Allocation. Timeouts. Introspection. Indexing.
4. Gem 1.
Power of 2 Allocation is
now on by default.
Allocation. Timeouts. Introspection. Indexing.
5. What happened?
Before 2.6, the default record
allocation used an exact-fit strategy.
Allocation. Timeouts. Introspection. Indexing.
6. Why does the allocation
strategy matter?
Allocation. Timeouts. Introspection. Indexing.
22. The 2.6 Fix
Use maxTimeMS to limit how long
an op can run in the database.
Allocation. Timeouts. Introspection. Indexing.
23. We’ve stopped the op.
Allocation. Timeouts. Introspection. Indexing.
24. We’ve stopped the op.
But why was it slow?
Allocation. Timeouts. Introspection. Indexing.
25. Gem 3.
Get inside the
Query Optimizer.
Allocation. Timeouts. Introspection. Indexing.
26. What happened?
For 2.6, we rewrote the query
execution framework — and
most of the time, it just works.
Allocation. Timeouts. Introspection. Indexing.
30. Allocation. Timeouts. Introspection. Indexing.
Query
Parser
Query Planner Plan
Cache
?
Hit
Return
Plan Runner
Miss
Plan Enumerator
Plan
Plan
Plan
31. Allocation. Timeouts. Introspection. Indexing.
Query
Parser
Query Planner Plan
Cache
?
Hit
Return
Plan Runner
Miss
Plan Enumerator
Plan
Plan
Plan
Multiplan Runner
32. Allocation. Timeouts. Introspection. Indexing.
Query
Parser
Query Planner Plan
Cache
?
Hit
Return
Plan Runner
Miss
Plan Enumerator
Plan
Plan
Plan
Multiplan Runner
Winner!
Cache
33. Allocation. Timeouts. Introspection. Indexing.
Query
Parser
Query Planner Plan
Cache
?
Hit
Return
Plan Runner
Miss
Plan Enumerator
Plan
Plan
Plan
Multiplan Runner
Winner!
Cache
34. Allocation. Timeouts. Introspection. Indexing.
Query Planner Plan
Cache
?
Hit
Return
Plan Runner
Query
Parser
The plan cache cuts out
a lot of processing.
36. Allocation. Timeouts. Introspection. Indexing.
Query
Parser
Query Planner Plan
Cache
?
Hit
Return
Plan Runner
!!!
The plan cache is caching
a suboptimal plan.
37. The 2.6 Fix
Add logging and introspection tools
to view and manipulate the cache,
such as getPlanCache.
Allocation. Timeouts. Introspection. Indexing.
38. Now we know what’s
wrong with the query.
Allocation. Timeouts. Introspection. Indexing.
39. Now we know what’s
wrong with the query.
Let’s fix it!
Allocation. Timeouts. Introspection. Indexing.
44. What happened?
Before 2.6, background index builds
became foreground index builds
when replicated to secondaries.
Allocation. Timeouts. Introspection. Indexing.
45. The 2.6 Fix
Now, background index builds
stay in the background.
Allocation. Timeouts. Introspection. Indexing.
47. > Power of 2 as Default Allocation Strategy
> Server-side Timeouts
> Query Engine Introspection
> Background Indexing on Secondaries
Here’s what we
covered:
Allocation. Timeouts. Introspection. Indexing.