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

Increase the size of the plan cache

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.6.0-rc1
    • Fix Version/s: 2.6.0-rc2
    • Component/s: Querying
    • Labels:
      None

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: