Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13221

Increase the size of the plan cache

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.0-rc2
    • Affects Version/s: 2.6.0-rc1
    • Component/s: Querying
    • Labels:
      None

      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.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: