[SERVER-13221] Increase the size of the plan cache Created: 15/Mar/14  Updated: 11/Jul/16  Resolved: 17/Mar/14

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.6.0-rc1
Fix Version/s: 2.6.0-rc2

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:

 Description   

The size of the plan cache for each collection is currently set to 200. This may be too small. For example, if an application generates lots of $all queries, we will consider queries with different numbers of elements in the $all as separate query shapes:

> t.ensureIndex({a: 1})
WriteResult({ "nInserted" : 1 })
> t.ensureIndex({b: 1})
WriteResult({ "nInserted" : 1 })
> t.find({a: 1, b: {$all: [1, 2]}})
> t.find({a: 1, b: {$all: [1, 2, 3]}})
> t.getPlanCache().listQueryShapes()
[
	{
		"query" : {
			"a" : 1,
			"b" : {
				"$all" : [
					1,
					2,
					3
				]
			}
		},
		"sort" : {
 
		},
		"projection" : {
 
		}
	},
	{
		"query" : {
			"a" : 1,
			"b" : {
				"$all" : [
					1,
					2
				]
			}
		},
		"sort" : {
 
		},
		"projection" : {
 
		}
	}
]
>

We may want to increase the size of the cache for this reason in order to accommodate larger numbers of query shapes.



 Comments   
Comment by Githook User [ 17/Mar/14 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-13221 increase plan cache size to 5000 entries

(cherry picked from commit 9faacb76de23e5b99904b4d5efc9ac2743415e1c)
Branch: v2.6
https://github.com/mongodb/mongo/commit/c17ce85e7bcb3ad078212a298298751e2b3b2d7b

Comment by Githook User [ 17/Mar/14 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-13221 increase plan cache size to 5000 entries
Branch: master
https://github.com/mongodb/mongo/commit/9faacb76de23e5b99904b4d5efc9ac2743415e1c

Generated at Thu Feb 08 03:31:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.