For scenarios in which plans repeatedly tie, SERVER-13675 introduces a performance regression. Ties can actually be quite common for some indexing schemes. For example, you might have indices {a: 1, b: 1} and {a: 1, c: 1} to support two different query patterns. When you query with a predicate over 'a' and without predicates over either 'b' or 'c', however, the two indices will always tie. Not caching one of the two tied plans means that we do extra work by going through the MultiPlanRunner path for every query of this shape.
Original Description
Problem:
Using mongo-perf, the Queries.TwoInts regresses in throughput from 2.6.1 to 2.6.2
Good 2.6.1
@@@START@@@ Queries.TwoInts 1 15183.6 2 31095.600000000002 4 49195.200000000004 8 84476.8 16 105745.2 32 110057.8 @@@END@@@ { "[object Object]" : { "1" : { "ops_per_sec" : 15183.6 }, "2" : { "ops_per_sec" : 31095.600000000002 }, "4" : { "ops_per_sec" : 49195.200000000004 }, "8" : { "ops_per_sec" : 84476.8 }, "16" : { "ops_per_sec" : 105745.2 }, "32" : { "ops_per_sec" : 110057.8 } } }
Bad Githash: 213700b3af4d53ce7e808dce2c638d98fc4f91db
@@@START@@@ Queries.TwoInts 1 9583.400000000001 2 19006.199999999997 4 33435 8 53750.399999999994 16 65717.4 32 67228.8 @@@END@@@ { "[object Object]" : { "1" : { "ops_per_sec" : 9583.400000000001 }, "2" : { "ops_per_sec" : 19006.199999999997 }, "4" : { "ops_per_sec" : 33435 }, "8" : { "ops_per_sec" : 53750.399999999994 }, "16" : { "ops_per_sec" : 65717.4 }, "32" : { "ops_per_sec" : 67228.8 } } }
- duplicates
-
SERVER-15225 CachedPlanStage should execute for trial period and re-plan if query performs poorly
- Closed
- is related to
-
SERVER-15237 Performance issue: Query Plan Cache is always empty
- Closed
- related to
-
SERVER-15152 When evaluating plans, some index candidates cause complete index scan
- Closed