SlideShare a Scribd company logo
Indexing and
Performance Tuning
Tom Schreiber
Senior Consulting Engineer, MongoDB
MongoDB's unique architecture
MongoDB's unique architecture
Indexes are the single biggest tunable
performance factor in MongoDB
Indexes are the single biggest tunable
performance factor in MongoDB
Mail from a German customer after a MongoDB Performance Tuning Consulting:
MongoDB's unique architecture
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.find({a:5})
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.find({a:5})
Full collection scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
# documents scanned:
1
db.test.find({a:5})
Full collection scan
!
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
!
db.test.find({a:5}) # documents scanned:
2
Full collection scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
!
db.test.find({a:5}) # documents scanned:
3
Full collection scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
!
db.test.find({a:5}) # documents scanned:
4
Full collection scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
!
db.test.find({a:5}) # documents scanned:
5
Full collection scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
!
db.test.find({a:5}) # documents scanned:
6
Full collection scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
!
db.test.find({a:5}) # documents scanned:
7
Full collection scan
db.test.find({a:5}) # documents scanned:
8
Full collection scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
!
db.test.find({a:5}) # documents scanned:
8
Full collection scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
!
Time Complexity for searching in a list with n entries: O(n)
db.test.find({a:5}) # documents scanned:
8
Full collection scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
!
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
1 5 17
7
113
Index on 'a'
db.test.find({a:5})
Index scan
9
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
1 5 17
7
113
Index on 'a'
db.test.find({a:5})
Index scan
9
!
db.test.find({a:5})
# index entries scanned: 1
Index scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
1 5 17
7
113
Index on 'a'
db.test.find({a:5})
Index scan
9!
db.test.find({a:5})
# index entries scanned: 2
Index scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
1 5 17
7
113
Index on 'a'
db.test.find({a:5})
Index scan
9
!
db.test.find({a:5})
# index entries scanned: 3
Index scan
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
1 5 17
7
113
Index on 'a'
db.test.find({a:5})
Index scan
9
# index entries scanned: 3
!
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
1 5 17
7
113
Index on 'a'
db.test.find({a:5})
Index scan
9
# documents scanned: 1
# index entries scanned: 3
!
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
1 5 17
7
113
Index on 'a'
db.test.find({a:5})
Index scan
9
# documents scanned: 1
# index entries scanned: 3
Time Complexity for
searching in a binary
search tree with n nodes:
O(log2	n)
log2	10.000	=	13
log2	100.000	=	16
log2	1.000.000	=	19
!
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:1})
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.find({a:{$gte:9,	$lte:17}})
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.find().sort({a:1})
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.find().sort({a:-1})
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:1})
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:-1})
7 1
17 11 9 35 1
https://github.com/mongodb/mongo/tree/v3.0/src/mongo/db/storage/mmap_v1/btree
https://github.com/mongodb/mongo/tree/v3.0/src/third_party/wiredtiger/src/btree
WiredTiger Index- and Data Structures
{'a':	3,	
	'b':	20}
1
{'b':	30,	
	'a':	9	}
2
{'c':	40,	
	'a':	1	}
3
{'c':	9,	
	'b':	4,	
	'a':	7}
4
{'a':	1,	
	'c':	20}
5
{'a':	11}
6
{'a':	17}
7
{'a':	5,	
	'b':	80}
8
1 3 5 7
1 5
7
4
11
6
17
7
1 3 7 11
1 7
5
8
3
1
1
5
1
3
Collection B+-Tree
Index B+-Tree
Index on 'a'
https://github.com/mongodb/mongo/tree/v3.0/src/third_party/wiredtiger/src/btree
9
2
{...} {...} {...} {...}{...} {...} {...}{...}
MMAPv1
Flat Files for Collections
{...} {...}{...} {...}{...} {...}{...}
B-Trees for Indexes
B-Trees for Collections
WiredTiger
Index (and Collection-) Data Structures
are Storage Engine specific
B-Tree Indexes
LSM-Tree Indexes
https://github.com/mongodb/mongo/tree/
v3.0/src/mongo/db/storage/mmap_v1
https://github.com/mongodb/mongo/tree/
v3.0/src/third_party/wiredtiger
Pluggable Storage Engine API
MongoDB Database Engine
{...} {...} {...} {...}{...} {...} {...} {...}
MMAPv1
Flat Files for Collections
{...} {...} {...} {...}{...} {...} {...}
B-Trees for Indexes
B-Trees for Collections
WiredTiger
. . .
Index (and Collection-) Data Structures
are Storage Engine specific
B-Tree Indexes
LSM-Tree Indexes
https://github.com/mongodb/mongo/tree/
v3.0/src/mongo/db/storage/mmap_v1
https://github.com/mongodb/mongo/tree/
v3.0/src/third_party/wiredtiger
Fractal-Tree
Indexes
TokuMXse
LSM-Tree
Indexes
RocksDB
Pluggable Storage Engine API
MongoDB Database Engine
Balancing Speed of Reads and WritesPerformance
Fast reads Fast writesBoth
Easy:
• Add indexes
Easy:
• No indexes
Hard:
• Smart schema design 

(hire a consultant)

• LSM index structures
B-Tree Indexes LSM-Tree Indexes
WiredTiger
B-Tree Index
WiredTiger
LSM-Index
WiredTiger
LSM-Index
WiredTiger
You can choose…
Single Thread
Update-heavy
"
Multi Thread
Update-heavy
"
Write-heavy
"
Analytics
"
Special
"
3rd party
In-Memory
In-Memory
In-Memory
Encrypted
MMAPv1
…even in the same replica set
Write-heavy
"
Analytics
"
Special
"
Secondary
Primary
Secondary
In-Memory
Encrypted
WiredTiger
LSM-Index
Query Execution Monitoring
tresult
The Query Optimizer
Chooses the most efficient query plan.
Information on query plans

and their execution statistics:
db.col.query.explain()
full collection scan
index on x
index on y
t0
Choose and Remenber
Terminate
db.col.query(...)
stage
plan root
stage stage
stage
stage stage
db.col.query.explain()
{...} {...} {...} {...} {...} {...} {...} {...} {...}
db.test.find({a:5}).explain()
{
"queryPlanner" : {
[...],
"winningPlan" : {
"stage" : "FETCH",
"inputStage" : {
"stage" : "IXSCAN",
"keyPattern" : {
"a" : 5
},
"indexName" : "a_1",
"isMultiKey" : false,
"direction" : "forward",
"indexBounds" : {
"a" : [
"[5.0, 5.0]"
]
}
}
}
},
[...]
}
db.test.find({a:5}).explain()
plan root
stage
FETCH
stage
IXSCAN
{
"queryPlanner" : {
[...],
"winningPlan" : {
"stage" : "FETCH",
"inputStage" : {
"stage" : "IXSCAN",
"keyPattern" : {
"a" : 5
},
"indexName" : "a_1",
"isMultiKey" : false,
"direction" : "forward",
"indexBounds" : {
"a" : [
"[5.0, 5.0]"
]
}
}
}
},
[...]
}
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:1})
db.test.find({a:5}).explain()
{	
		"queryPlanner"	:	{	
				[...],	
				"winningPlan"	:	{	
						"stage"	:	"FETCH",	
						"inputStage"	:	{	
								"stage"	:	"IXSCAN",	
								"keyPattern"	:	{	
										"a"	:	5	
								},	
								"indexName"	:	"a_1",	
								"isMultiKey"	:	false,	
								"direction"	:	"forward",	
								"indexBounds"	:	{	
										"a"	:	[	
												"[5.0,	5.0]"	
										]	
								}	
						}	
				}	
		},	
		[...]	
}	
stage
FETCH
plan root
stage
IXSCAN
Explain Levels
queryPlanner
"Which plan will MongoDB choose to run my query?"
executionStats
"How is my query performing?"
allPlansExecution
"I want as much information as possible to diagnose a slow query."
{
[...],
"executionStats" : {
"executionSuccess" : true,
"nReturned" : 1,
"executionTimeMillis" : 0,
"totalKeysExamined" : 1,
"totalDocsExamined" : 1,
"executionStages" : {
"stage" : "FETCH",
"nReturned" : 1,
"executionTime
MillisEstimate" : 0,
"works" : 2,
"advanced" : 1,
"needTime" : 0,
"needFetch" : 0,
"saveState" : 0,
"restoreState" : 0,
"isEOF" : 1,
"invalidates" : 0,
"docsExamined" : 1,
"alreadyHasObj" : 0,
"inputStage" : {
"stage" : "IXSCAN",
db.test.find({a:5}).explain("executionStats")db.test.find({a:5}).explain()
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:1})
stage
IXSCAN
stage
FETCH
plan root
"invalidates"	:	0,

				"docsExamined"	:	1,

				"alreadyHasObj"	:	0,

				

				"inputStage"	:	{

				

						"stage"	:	"IXSCAN",

						"nReturned"	:	1,

						"executionTime	
							MillisEstimate"	:	0,

						"works"	:	1,

						"advanced"	:	1,

						"needTime"	:	0,

						"needFetch"	:	0,

						"saveState"	:	0,

						"restoreState"	:	0,

						"isEOF"	:	1,

						"invalidates"	:	0,

						"keyPattern"	:	{

								"a"	:	5

						},

						"indexName"	:	"a_1",

						"isMultiKey"	:	false,

						"direction"	:	"forward",

						"indexBounds"	:	{

								"a"	:	[

										"[5.0,			5.0]"

								]

						},

						"keysExamined"	:	1,

						"dupsTested"	:	0,

						"dupsDropped"	:	0,

						"seenInvalidated"	:	0,

						"matchTested"	:	0

db.test.find({a:5}).explain("executionStats")db.test.find({a:5}).explain()
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:1})
stage
IXSCAN
stage
FETCH
plan root
1
1
Loc1 Loc6Loc3 Loc4 Loc5Loc2 Loc7 Loc8Loc8
!!
"invalidates"	:	0,

				"docsExamined"	:	1,

				"alreadyHasObj"	:	0,

				

				"inputStage"	:	{

				

						"stage"	:	"IXSCAN",

						"nReturned"	:	1,

						"executionTime	
							MillisEstimate"	:	0,

						"works"	:	1,

						"advanced"	:	1,

						"needTime"	:	0,

						"needFetch"	:	0,

						"saveState"	:	0,

						"restoreState"	:	0,

						"isEOF"	:	1,

						"invalidates"	:	0,

						"keyPattern"	:	{

								"a"	:	5

						},

						"indexName"	:	"a_1",

						"isMultiKey"	:	false,

						"direction"	:	"forward",

						"indexBounds"	:	{

								"a"	:	[

										"[5.0,			5.0]"

								]

						},

						"keysExamined"	:	1,

						"dupsTested"	:	0,

						"dupsDropped"	:	0,

						"seenInvalidated"	:	0,

						"matchTested"	:	0

db.test.find({a:5}).explain("executionStats")db.test.find({a:5}).explain()
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:1})
stage
IXSCAN
stage
FETCH
plan root
1
1
Loc8
Loc1 Loc6Loc3 Loc4 Loc5Loc2 Loc7 Loc8
"invalidates"	:	0,

				"docsExamined"	:	1,

				"alreadyHasObj"	:	0,

				

				"inputStage"	:	{

				

						"stage"	:	"IXSCAN",

						"nReturned"	:	1,

						"executionTime	
							MillisEstimate"	:	0,

						"works"	:	1,

						"advanced"	:	1,

						"needTime"	:	0,

						"needFetch"	:	0,

						"saveState"	:	0,

						"restoreState"	:	0,

						"isEOF"	:	1,

						"invalidates"	:	0,

						"keyPattern"	:	{

								"a"	:	5

						},

						"indexName"	:	"a_1",

						"isMultiKey"	:	false,

						"direction"	:	"forward",

						"indexBounds"	:	{

								"a"	:	[

										"[5.0,			5.0]"

								]

						},

						"keysExamined"	:	1,

						"dupsTested"	:	0,

						"dupsDropped"	:	0,

						"seenInvalidated"	:	0,

						"matchTested"	:	0

db.test.find({a:5}).explain("executionStats")db.test.find({a:5}).explain()
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:1})
stage
IXSCAN
stage
FETCH
plan root
1
1
Loc8
Loc1 Loc6Loc3 Loc4 Loc5Loc2 Loc7 Loc8
"executionTimeMillis"	:	0,

		"totalKeysExamined"	:	1,

		"totalDocsExamined"	:	1,

		

		"executionStages"	:	{

				

				"stage"	:	"FETCH",

				"nReturned"	:	1,

				"executionTime	
					MillisEstimate"	:	0,

				"works"	:	2,

				"advanced"	:	1,

				"needTime"	:	0,

				"needFetch"	:	0,

				"saveState"	:	0,

				"restoreState"	:	0,

				"isEOF"	:	1,

				"invalidates"	:	0,

				"docsExamined"	:	1,

				"alreadyHasObj"	:	0,

				

				"inputStage"	:	{

				

						"stage"	:	"IXSCAN",

						"nReturned"	:	1,

						"executionTime	
							MillisEstimate"	:	0,

						"works"	:	1,

						"advanced"	:	1,

						"needTime"	:	0,

						"needFetch"	:	0,

						"saveState"	:	0,

						"restoreState"	:	0,

						"isEOF"	:	1,

db.test.find({a:5}).explain("executionStats")db.test.find({a:5}).explain()
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:1})
stage
IXSCAN
stage
FETCH
plan root
1
1
1
1
Loc8
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
!
db.test.find({a:5}) # documents scanned:
2
Full collection scan
Loc1 Loc6Loc3 Loc4 Loc5Loc2 Loc7 Loc8
"executionTimeMillis"	:	0,

		"totalKeysExamined"	:	1,

		"totalDocsExamined"	:	1,

		

		"executionStages"	:	{

				

				"stage"	:	"FETCH",

				"nReturned"	:	1,

				"executionTime	
					MillisEstimate"	:	0,

				"works"	:	2,

				"advanced"	:	1,

				"needTime"	:	0,

				"needFetch"	:	0,

				"saveState"	:	0,

				"restoreState"	:	0,

				"isEOF"	:	1,

				"invalidates"	:	0,

				"docsExamined"	:	1,

				"alreadyHasObj"	:	0,

				

				"inputStage"	:	{

				

						"stage"	:	"IXSCAN",

						"nReturned"	:	1,

						"executionTime	
							MillisEstimate"	:	0,

						"works"	:	1,

						"advanced"	:	1,

						"needTime"	:	0,

						"needFetch"	:	0,

						"saveState"	:	0,

						"restoreState"	:	0,

						"isEOF"	:	1,

db.test.find({a:5}).explain("executionStats")db.test.find({a:5}).explain()
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:1})
stage
IXSCAN
stage
FETCH
plan root
1
1
1
1
Loc8
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
!
db.test.find({a:5}) # documents scanned:
2
Full collection scan
Loc1 Loc6Loc3 Loc4 Loc5Loc2 Loc7 Loc8
"docsExamined"	:	1,

				"alreadyHasObj"	:	0,

				

				"inputStage"	:	{

				

						"stage"	:	"IXSCAN",

						"nReturned"	:	1,

						"executionTime	
							MillisEstimate"	:	0,

						"works"	:	1,

						"advanced"	:	1,

						"needTime"	:	0,

						"needFetch"	:	0,

						"saveState"	:	0,

						"restoreState"	:	0,

						"isEOF"	:	1,

						"invalidates"	:	0,

						"keyPattern"	:	{

								"a"	:	5

						},

						"indexName"	:	"a_1",

						"isMultiKey"	:	false,

						"direction"	:	"forward",

						"indexBounds"	:	{

								"a"	:	[

										"[5.0,			5.0]"

								]

						},

						"keysExamined"	:	1,

						"dupsTested"	:	0,

						"dupsDropped"	:	0,

						"seenInvalidated"	:	0,

						"matchTested"	:	0

				}

Explain() method key metrics
# documents returned
How long did the query take
# index entries scanned
# documents scanned
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:1})
Index used? Which one?
				"docsExamined"	:	1,

				"alreadyHasObj"	:	0,

				

				"inputStage"	:	{

				

						"stage"	:	"IXSCAN",

						"nReturned"	:	1,

						"executionTime	
							MillisEstimate"	:	0,

						"works"	:	1,

						"advanced"	:	1,

						"needTime"	:	0,

						"needFetch"	:	0,

						"saveState"	:	0,

						"restoreState"	:	0,

						"isEOF"	:	1,

						"invalidates"	:	0,

						"keyPattern"	:	{

								"a"	:	5

						},

						"indexName"	:	"a_1",

						"isMultiKey"	:	false,

						"direction"	:	"forward",

						"indexBounds"	:	{

								"a"	:	[

										"[5.0,			5.0]"

								]

						},

						"keysExamined"	:	1,

						"dupsTested"	:	0,

						"dupsDropped"	:	0,

						"seenInvalidated"	:	0,

						"matchTested"	:	0

				}

Explain() method key metrics
"IXSCAN"
"indexName"	:	"a_1"
# documents returned
How long did the query take
# index entries scanned
# documents scanned
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
Index on 'a'
1 7
3 51 17119
MongoDB Index Data Structure: B-Tree
{'a':	3,	
	'b':	20}
{'b':	30,	
	'a':	9	}
{'c':	40,	
	'a':	1	}
{'c':	9,	
	'b':	4,	
	'a':	7}
{'a':	1,	
	'c':	20}
{'a':	11} {'a':	17}
{'a':	5,	
	'b':	80}
db.test.createIndex({a:1})
Performance Tuning with
Query Execution Monitoring
United States Postal Service ZIP-Codes
db.zips.find() 29353 documents
media.mongodb.org/zips.json
{	"zip"	:	"01001",	"city"	:	"AGAWAM",	"loc"	:	[	-72.622739,	42.070206	],	"pop"	:	15338,	"state"	:	"MA"	}	
{	"zip"	:	"01002",	"city"	:	"CUSHMAN",	"loc"	:	[	-72.51564999999999,	42.377017	],	"pop"	:	36963,	"state"	:	"MA"	}	
{	"zip"	:	"01005",	"city"	:	"BARRE",	"loc"	:	[	-72.10835400000001,	42.409698	],	"pop"	:	4546,	"state"	:	"MA"	}	
{	"zip"	:	"01007",	"city"	:	"BELCHERTOWN",	"loc"	:	[	-72.41095300000001,	42.275103	],	"pop"	:	10579,	"state"	:	"MA"	}	
{	"zip"	:	"01008",	"city"	:	"BLANDFORD",	"loc"	:	[	-72.936114,	42.182949	],	"pop"	:	1240,	"state"	:	"MA"	}	
{	"zip"	:	"01010",	"city"	:	"BRIMFIELD",	"loc"	:	[	-72.188455,	42.116543	],	"pop"	:	3706,	"state"	:	"MA"	}	
{	"zip"	:	"01011",	"city"	:	"CHESTER",	"loc"	:	[	-72.988761,	42.279421	],	"pop"	:	1688,	"state"	:	"MA"	}	
{	"zip"	:	"01012",	"city"	:	"CHESTERFIELD",	"loc"	:	[	-72.833309,	42.38167	],	"pop"	:	177,	"state"	:	"MA"	}	
{	"zip"	:	"01013",	"city"	:	"CHICOPEE",	"loc"	:	[	-72.607962,	42.162046	],	"pop"	:	23396,	"state"	:	"MA"	}	
{	"zip"	:	"01020",	"city"	:	"CHICOPEE",	"loc"	:	[	-72.576142,	42.176443	],	"pop"	:	31495,	"state"	:	"MA"	}	
{	"zip"	:	"01022",	"city"	:	"WESTOVER	AFB",	"loc"	:	[	-72.558657,	42.196672	],	"pop"	:	1764,	"state"	:	"MA"	}	
{	"zip"	:	"01026",	"city"	:	"CUMMINGTON",	"loc"	:	[	-72.905767,	42.435296	],	"pop"	:	1484,	"state"	:	"MA"	}	
{	"zip"	:	"01027",	"city"	:	"MOUNT	TOM",	"loc"	:	[	-72.67992099999999,	42.264319	],	"pop"	:	16864,	"state"	:	"MA"	}	
{	"zip"	:	"01028",	"city"	:	"EAST	LONGMEADOW",	"loc"	:	[	-72.505565,	42.067203	],	"pop"	:	13367,	"state"	:	"MA"	}	
{	"zip"	:	"01030",	"city"	:	"FEEDING	HILLS",	"loc"	:	[	-72.675077,	42.07182	],	"pop"	:	11985,	"state"	:	"MA"	}	
{	"zip"	:	"01031",	"city"	:	"GILBERTVILLE",	"loc"	:	[	-72.19858499999999,	42.332194	],	"pop"	:	2385,	"state"	:	"MA"	}	
{	"zip"	:	"01032",	"city"	:	"GOSHEN",	"loc"	:	[	-72.844092,	42.466234	],	"pop"	:	122,	"state"	:	"MA"	}	
{	"zip"	:	"01033",	"city"	:	"GRANBY",	"loc"	:	[	-72.52000099999999,	42.255704	],	"pop"	:	5526,	"state"	:	"MA"	}	
{	"zip"	:	"01034",	"city"	:	"TOLLAND",	"loc"	:	[	-72.908793,	42.070234	],	"pop"	:	1652,	"state"	:	"MA"	}	
{	"zip"	:	"01035",	"city"	:	"HADLEY",	"loc"	:	[	-72.571499,	42.36062	],	"pop"	:	4231,	"state"	:	"MA"	}
Question
Zip codes in New York City with population more than
100,000 ordered by population in descending order
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1})
{"zip" : "10021", "city" : "NEW YORK", "pop" : 106564, "state" : "NY" }
{"zip" : "10025", "city" : "NEW YORK", "pop" : 100027, "state" : "NY" }
{	"zip"	:	"99921",	"city"	:	"CRAIG",	"loc"	:	[	-133.117081,	55.47317	],	"pop"	:	1398,	"state"	:	"AK"	}	
{	"zip"	:	"99922",	"city"	:	"HYDABURG",	"loc"	:	[	-132.633175,	55.137406	],	"pop"	:	891,	"state"	:	"AK"	}	
{	"zip"	:	"99923",	"city"	:	"HYDER",	"loc"	:	[	-130.124915,	55.925867	],	"pop"	:	116,	"state"	:	"AK"	}	
{	"zip"	:	"99925",	"city"	:	"KLAWOCK",	"loc"	:	[	-133.055503,	55.552611	],	"pop"	:	851,	"state"	:	"AK"	}	
{	"zip"	:	"99926",	"city"	:	"METLAKATLA",	"loc"	:	[	-131.579001,	55.121491	],	"pop"	:	1469,	"state"	:	"AK"	}	
{	"zip"	:	"99927",	"city"	:	"POINT	BAKER",	"loc"	:	[	-133.376372,	56.307858	],	"pop"	:	426,	"state"	:	"AK"	}	
{	"zip"	:	"99929",	"city"	:	"WRANGELL",	"loc"	:	[	-132.352918,	56.433524	],	"pop"	:	2573,	"state"	:	"AK"	}	
{	"zip"	:	"99950",	"city"	:	"KETCHIKAN",	"loc"	:	[	-133.18479,	55.942471	],	"pop"	:	422,	"state"	:	"AK"	}
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1})
No Index
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
No Index
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
{	
		"queryPlanner"	:	{	
						"winningPlan"	:	{	
						"stage"	:	"SORT",	
						"sortPattern"	:	{	
								"pop"	:	-1	
						},	
						"inputStage"	:	{	
								"stage"	:	"COLLSCAN",	
								"filter"	:	{	
										"$and"	:	[	
												{	
														"city"	:	{	
																"$eq"	:	"NEW	YORK"	
														}	
												},	
												{	
														"state"	:	{	
																"$eq"	:	"NY"	
														}	
No Index
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
plan root
{	
		"queryPlanner"	:	{	
						"winningPlan"	:	{	
						"stage"	:	"SORT",	
						"sortPattern"	:	{	
								"pop"	:	-1	
						},	
						"inputStage"	:	{	
								"stage"	:	"COLLSCAN",	
								"filter"	:	{	
										"$and"	:	[	
												{	
														"city"	:	{	
																"$eq"	:	"NEW	YORK"	
														}	
												},	
												{	
														"state"	:	{	
																"$eq"	:	"NY"	
														}	
No Index
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
plan root
SORT
{	
		"queryPlanner"	:	{	
						"winningPlan"	:	{	
						"stage"	:	"SORT",	
						"sortPattern"	:	{	
								"pop"	:	-1	
						},	
						"inputStage"	:	{	
								"stage"	:	"COLLSCAN",	
								"filter"	:	{	
										"$and"	:	[	
												{	
														"city"	:	{	
																"$eq"	:	"NEW	YORK"	
														}	
												},	
												{	
														"state"	:	{	
																"$eq"	:	"NY"	
														}	
No Index
{	
		"queryPlanner"	:	{	
						"winningPlan"	:	{	
						"stage"	:	"SORT",	
						"sortPattern"	:	{	
								"pop"	:	-1	
						},	
						"inputStage"	:	{	
								"stage"	:	"COLLSCAN",	
								"filter"	:	{	
										"$and"	:	[	
												{	
														"city"	:	{	
																"$eq"	:	"NEW	YORK"	
														}	
												},	
												{	
														"state"	:	{	
																"$eq"	:	"NY"	
														}	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
plan root
SORT
COLLSCAN {...} {...} {...} {...} {...} {...} {...} {...} {...}
Collection Scan!
No Index
}	
												},	
												{	
														"pop"	:	{	
																"$gt"	:	100000	
														}	
												}	
										]	
								},	
								"direction"	:	"forward"	
						}	
				},	
				"rejectedPlans"	:	[	]	
		},	
		"executionStats"	:	{	
				"executionSuccess"	:	true,	
				"nReturned"	:	2,	
				"executionTimeMillis"	:	15,	
				"totalKeysExamined"	:	0,	
				"totalDocsExamined"	:	29353,	
				"executionStages"	:	{	
						"stage"	:	"SORT",	
						"nReturned"	:	2,	
						"executionTimeMillisEstimate"	:	0,	
						"works"	:	29359,	
						"advanced"	:	2,	
						"needTime"	:	29355,	
						"needFetch"	:	0,	
						"saveState"	:	229,	
						"restoreState"	:	229,	
						"isEOF"	:	1,	
						"invalidates"	:	0,	
						"sortPattern"	:	{	
								"pop"	:	-1	
.explain("executionStats")
{...} {...} {...} {...} {...} {...} {...} {...} {...}
plan root
SORT
COLLSCAN
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Collection Scan!
No Index
}	
												},	
												{	
														"pop"	:	{	
																"$gt"	:	100000	
														}	
												}	
										]	
								},	
								"direction"	:	"forward"	
						}	
				},	
				"rejectedPlans"	:	[	]	
		},	
		"executionStats"	:	{	
				"executionSuccess"	:	true,	
				"nReturned"	:	2,	
				"executionTimeMillis"	:	15,	
				"totalKeysExamined"	:	0,	
				"totalDocsExamined"	:	29353,	
				"executionStages"	:	{	
						"stage"	:	"SORT",	
						"nReturned"	:	2,	
						"executionTimeMillisEstimate"	:	0,	
						"works"	:	29359,	
						"advanced"	:	2,	
						"needTime"	:	29355,	
						"needFetch"	:	0,	
						"saveState"	:	229,	
						"restoreState"	:	229,	
						"isEOF"	:	1,	
						"invalidates"	:	0,	
						"sortPattern"	:	{	
								"pop"	:	-1	
.explain("executionStats")
{...} {...} {...} {...} {...} {...} {...} {...} {...}
2 documents returnedplan root
SORT
COLLSCAN
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Collection Scan!
No Index
}	
												},	
												{	
														"pop"	:	{	
																"$gt"	:	100000	
														}	
												}	
										]	
								},	
								"direction"	:	"forward"	
						}	
				},	
				"rejectedPlans"	:	[	]	
		},	
		"executionStats"	:	{	
				"executionSuccess"	:	true,	
				"nReturned"	:	2,	
				"executionTimeMillis"	:	15,	
				"totalKeysExamined"	:	0,	
				"totalDocsExamined"	:	29353,	
				"executionStages"	:	{	
						"stage"	:	"SORT",	
						"nReturned"	:	2,	
						"executionTimeMillisEstimate"	:	0,	
						"works"	:	29359,	
						"advanced"	:	2,	
						"needTime"	:	29355,	
						"needFetch"	:	0,	
						"saveState"	:	229,	
						"restoreState"	:	229,	
						"isEOF"	:	1,	
						"invalidates"	:	0,	
						"sortPattern"	:	{	
								"pop"	:	-1	
.explain("executionStats")
{...} {...} {...} {...} {...} {...} {...} {...} {...}
2 documents returned
29353 documents scanned
plan root
SORT
COLLSCAN
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Collection Scan!
No Index
}	
												},	
												{	
														"pop"	:	{	
																"$gt"	:	100000	
														}	
												}	
										]	
								},	
								"direction"	:	"forward"	
						}	
				},	
				"rejectedPlans"	:	[	]	
		},	
		"executionStats"	:	{	
				"executionSuccess"	:	true,	
				"nReturned"	:	2,	
				"executionTimeMillis"	:	15,	
				"totalKeysExamined"	:	0,	
				"totalDocsExamined"	:	29353,	
				"executionStages"	:	{	
						"stage"	:	"SORT",	
						"nReturned"	:	2,	
						"executionTimeMillisEstimate"	:	0,	
						"works"	:	29359,	
						"advanced"	:	2,	
						"needTime"	:	29355,	
						"needFetch"	:	0,	
						"saveState"	:	229,	
						"restoreState"	:	229,	
						"isEOF"	:	1,	
						"invalidates"	:	0,	
						"sortPattern"	:	{	
								"pop"	:	-1	
.explain("executionStats")
{...} {...} {...} {...} {...} {...} {...} {...} {...}
2 documents returned
29353 documents scanned
plan root
SORT
COLLSCAN
In-Memory Sort!
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Collection Scan!
No Index
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Single Field Index
db.zips.createIndex({state:1})
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Single Field Index
db.zips.createIndex({state:1})
{	
		"queryPlanner":	{	
				"winningPlan":	{	
						"stage":	"SORT",	
						"sortPattern":	{	
								"pop":	-1	
						},	
						"inputStage":	{	
								"stage":	"FETCH",	
								"filter":	{	
										"$and":	[	
												{	
														"city":	{	
																"$eq":	"NEW	YORK"	
														}	
												},	
												{	
														"pop":	{	
																"$gt":	100000	
														}	
plan root
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Single Field Index
db.zips.createIndex({state:1})
{	
		"queryPlanner":	{	
				"winningPlan":	{	
						"stage":	"SORT",	
						"sortPattern":	{	
								"pop":	-1	
						},	
						"inputStage":	{	
								"stage":	"FETCH",	
								"filter":	{	
										"$and":	[	
												{	
														"city":	{	
																"$eq":	"NEW	YORK"	
														}	
												},	
												{	
														"pop":	{	
																"$gt":	100000	
														}	
plan root
SORT
{	
		"queryPlanner":	{	
				"winningPlan":	{	
						"stage":	"SORT",	
						"sortPattern":	{	
								"pop":	-1	
						},	
						"inputStage":	{	
								"stage":	"FETCH",	
								"filter":	{	
										"$and":	[	
												{	
														"city":	{	
																"$eq":	"NEW	YORK"	
														}	
												},	
												{	
														"pop":	{	
																"$gt":	100000	
														}	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Single Field Index
db.zips.createIndex({state:1})
plan root
SORT
FETCH
"pop":	-1	
						},	
						"inputStage":	{	
								"stage":	"FETCH",	
								"filter":	{	
										"$and":	[	
												{	
														"city":	{	
																"$eq":	"NEW	YORK"	
														}	
												},	
												{	
														"pop":	{	
																"$gt":	100000	
														}	
												}	
										]	
								},	
								"inputStage":	{	
										"stage":	"IXSCAN",	
										"keyPattern":	{	
												"state":	1	
										},	
										"indexName":	"state_1",	
										"isMultiKey":	false,	
										"direction":	"forward",	
										"indexBounds":	{	
												"state":	[	
														"["NY",	"NY"]"	
												]	
										}	
								}	
						}	
				},	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Single Field Index
db.zips.createIndex({state:1})
plan root
SORT
FETCH
"pop":	-1	
						},	
						"inputStage":	{	
								"stage":	"FETCH",	
								"filter":	{	
										"$and":	[	
												{	
														"city":	{	
																"$eq":	"NEW	YORK"	
														}	
												},	
												{	
														"pop":	{	
																"$gt":	100000	
														}	
												}	
										]	
								},	
								"inputStage":	{	
										"stage":	"IXSCAN",	
										"keyPattern":	{	
												"state":	1	
										},	
										"indexName":	"state_1",	
										"isMultiKey":	false,	
										"direction":	"forward",	
										"indexBounds":	{	
												"state":	[	
														"["NY",	"NY"]"	
												]	
										}	
								}	
						}	
				},	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Single Field Index
db.zips.createIndex({state:1})
plan root
SORT
FETCH
IXSCAN
{...} {...} {...} {...} {...} {...} {...} {...} {...}
},	
										"indexName":	"state_1",	
										"isMultiKey":	false,	
										"direction":	"forward",	
										"indexBounds":	{	
												"state":	[	
														"["NY",	"NY"]"	
												]	
										}	
								}	
						}	
				},	
				"rejectedPlans":	[]	
		},	
		"executionStats":	{	
				"executionSuccess":	true,	
				"nReturned":	2,	
				"executionTimeMillis":	6,	
				"totalKeysExamined":	1595,	
				"totalDocsExamined":	1595,	
				"executionStages":	{	
						"stage":	"SORT",	
						"nReturned":	2,	
						"executionTimeMillisEstimate":	0,	
						"works":	1600,	
						"advanced":	2,	
						"needTime":	1596,	
						"needFetch":	0,	
						"saveState":	12,	
						"restoreState":	12,	
						"isEOF":	1,	
						"invalidates":	0,	
						"sortPattern":	{	
								"pop":	-1	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Single Field Index
db.zips.createIndex({state:1})
plan root
SORT
FETCH
IXSCAN
{...} {...} {...} {...} {...} {...} {...} {...} {...}
},	
										"indexName":	"state_1",	
										"isMultiKey":	false,	
										"direction":	"forward",	
										"indexBounds":	{	
												"state":	[	
														"["NY",	"NY"]"	
												]	
										}	
								}	
						}	
				},	
				"rejectedPlans":	[]	
		},	
		"executionStats":	{	
				"executionSuccess":	true,	
				"nReturned":	2,	
				"executionTimeMillis":	6,	
				"totalKeysExamined":	1595,	
				"totalDocsExamined":	1595,	
				"executionStages":	{	
						"stage":	"SORT",	
						"nReturned":	2,	
						"executionTimeMillisEstimate":	0,	
						"works":	1600,	
						"advanced":	2,	
						"needTime":	1596,	
						"needFetch":	0,	
						"saveState":	12,	
						"restoreState":	12,	
						"isEOF":	1,	
						"invalidates":	0,	
						"sortPattern":	{	
								"pop":	-1	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Single Field Index
db.zips.createIndex({state:1})
plan root
SORT
FETCH
IXSCAN
2 documents returned
{...} {...} {...} {...} {...} {...} {...} {...} {...}
},	
										"indexName":	"state_1",	
										"isMultiKey":	false,	
										"direction":	"forward",	
										"indexBounds":	{	
												"state":	[	
														"["NY",	"NY"]"	
												]	
										}	
								}	
						}	
				},	
				"rejectedPlans":	[]	
		},	
		"executionStats":	{	
				"executionSuccess":	true,	
				"nReturned":	2,	
				"executionTimeMillis":	6,	
				"totalKeysExamined":	1595,	
				"totalDocsExamined":	1595,	
				"executionStages":	{	
						"stage":	"SORT",	
						"nReturned":	2,	
						"executionTimeMillisEstimate":	0,	
						"works":	1600,	
						"advanced":	2,	
						"needTime":	1596,	
						"needFetch":	0,	
						"saveState":	12,	
						"restoreState":	12,	
						"isEOF":	1,	
						"invalidates":	0,	
						"sortPattern":	{	
								"pop":	-1	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Single Field Index
db.zips.createIndex({state:1})
plan root
SORT
FETCH
IXSCAN
2 documents returned
1595 index entries scanned
{...} {...} {...} {...} {...} {...} {...} {...} {...}
},	
										"indexName":	"state_1",	
										"isMultiKey":	false,	
										"direction":	"forward",	
										"indexBounds":	{	
												"state":	[	
														"["NY",	"NY"]"	
												]	
										}	
								}	
						}	
				},	
				"rejectedPlans":	[]	
		},	
		"executionStats":	{	
				"executionSuccess":	true,	
				"nReturned":	2,	
				"executionTimeMillis":	6,	
				"totalKeysExamined":	1595,	
				"totalDocsExamined":	1595,	
				"executionStages":	{	
						"stage":	"SORT",	
						"nReturned":	2,	
						"executionTimeMillisEstimate":	0,	
						"works":	1600,	
						"advanced":	2,	
						"needTime":	1596,	
						"needFetch":	0,	
						"saveState":	12,	
						"restoreState":	12,	
						"isEOF":	1,	
						"invalidates":	0,	
						"sortPattern":	{	
								"pop":	-1	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Single Field Index
db.zips.createIndex({state:1})
plan root
SORT
FETCH
IXSCAN
2 documents returned
1595 documents scanned
1595 index entries scanned
{...} {...} {...} {...} {...} {...} {...} {...} {...}
},	
										"indexName":	"state_1",	
										"isMultiKey":	false,	
										"direction":	"forward",	
										"indexBounds":	{	
												"state":	[	
														"["NY",	"NY"]"	
												]	
										}	
								}	
						}	
				},	
				"rejectedPlans":	[]	
		},	
		"executionStats":	{	
				"executionSuccess":	true,	
				"nReturned":	2,	
				"executionTimeMillis":	6,	
				"totalKeysExamined":	1595,	
				"totalDocsExamined":	1595,	
				"executionStages":	{	
						"stage":	"SORT",	
						"nReturned":	2,	
						"executionTimeMillisEstimate":	0,	
						"works":	1600,	
						"advanced":	2,	
						"needTime":	1596,	
						"needFetch":	0,	
						"saveState":	12,	
						"restoreState":	12,	
						"isEOF":	1,	
						"invalidates":	0,	
						"sortPattern":	{	
								"pop":	-1	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
Single Field Index
db.zips.createIndex({state:1})
plan root
SORT
FETCH
IXSCAN
2 documents returned
1595 documents scanned
1595 index entries scanned
In-Memory Sort!
{...} {...} {...} {...} {...} {...} {...} {...} {...}
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1})
db.zips.createIndex({state:1})
NY NY NY NY NY NY NY NY NY NY NY NY NY NY NY OH OH OH OH OH OH OH OH OH O
NY TX
NY
NY OH OK OR
{	"state"	:	"NY",		"city"	:	"NEW	YORK",									"pop"	:	106564,	"zip"	:	"10021",	"loc"	:	[	-73.958805,	40.768476	]	}	
{	"state"	:	"NY",		"city"	:	"NORTH	TARRYTOWN",		"pop"	:	20080,		"zip"	:	"10591",	"loc"	:	[	-73.859335,	41.078108	]	}	
{	"state"	:	"NY",		"city"	:	"YONKERS",										"pop"	:	19958,		"zip"	:	"10703",	"loc"	:	[	-73.885163,	40.951763	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",									"pop"	:	18913,		"zip"	:	"10001",	"loc"	:	[	-73.996705,	40.74838	]	}	
{	"state"	:	"NY",		"city"	:	"WHITE	PLAINS",					"pop"	:	17843,		"zip"	:	"10605",	"loc"	:	[	-73.755247,	41.014053	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",									"pop"	:	84143,		"zip"	:	"10002",	"loc"	:	[	-73.987681,	40.715231	]	}	
{	"state"	:	"NY",		"city"	:	"WHITE	PLAINS",					"pop"	:	13436,		"zip"	:	"10606",	"loc"	:	[	-73.778097,	41.024714	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",									"pop"	:	12465,		"zip"	:	"10017",	"loc"	:	[	-73.970661,	40.75172	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",									"pop"	:	100027,	"zip"	:	"10025",	"loc"	:	[	-73.968312,	40.797466	]	}	
{	"state"	:	"NY",		"city"	:	"EAST	WHITE	PLAIN",	"pop"	:	8899,			"zip"	:	"10604",	"loc"	:	[	-73.750727,	41.043295	]	}	
{	"state"	:	"NY",		"city"	:	"HASTINGS	ON	HUDS",	"pop"	:	8546,			"zip"	:	"10706",	"loc"	:	[	-73.875912,	40.99071	]	}	
{	"state"	:	"NY",		"city"	:	"WHITE	PLAINS",					"pop"	:	8397,			"zip"	:	"10601",	"loc"	:	[	-73.765231,	41.032955	]	}	
{	"state"	:	"NY",		"city"	:	"PUTNAM	VALLEY",				"pop"	:	7453,			"zip"	:	"10579",	"loc"	:	[	-73.85024,	41.372815	]	}
db.zips.createIndex({state:1,	city:1})
Compound Index on two fields
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
{

		"queryPlanner":	{

				"winningPlan":	{

						"stage":	"SORT",

						"sortPattern":	{

								"pop":	-1

						},

						"inputStage":	{

								"stage":	"FETCH",

								"filter":	{

										"pop":	{

												"$gt":	100000

										}

								},

								"inputStage":	{

										"stage":	"IXSCAN",

										"keyPattern":	{

												"state":	1,

												"city":	1

										},

db.zips.createIndex({state:1,	city:1})
Compound Index on two fields
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
{

		"queryPlanner":	{

				"winningPlan":	{

						"stage":	"SORT",

						"sortPattern":	{

								"pop":	-1

						},

						"inputStage":	{

								"stage":	"FETCH",

								"filter":	{

										"pop":	{

												"$gt":	100000

										}

								},

								"inputStage":	{

										"stage":	"IXSCAN",

										"keyPattern":	{

												"state":	1,

												"city":	1

										},

db.zips.createIndex({state:1,	city:1})
Compound Index on two fields
plan root
SORT
FETCH
IXSCAN
{...} {...} {...} {...} {...} {...} {...} {...} {...}
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
{

		"queryPlanner":	{

				"winningPlan":	{

						"stage":	"SORT",

						"sortPattern":	{

								"pop":	-1

						},

						"inputStage":	{

								"stage":	"FETCH",

								"filter":	{

										"pop":	{

												"$gt":	100000

										}

								},

								"inputStage":	{

										"stage":	"IXSCAN",

										"keyPattern":	{

												"state":	1,

												"city":	1

										},

										"indexName":	"state_1_city_1",

										"isMultiKey":	false,

										"direction":	"forward",

										"indexBounds":	{

												"state":	[

														"["NY",	"NY"]"

												],

												"city":	[

														"["NEW	YORK",	"NEW	YORK
"]"

												]

										}

								}

						}

db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,	city:1})
Compound Index on two fields
plan root
SORT
FETCH
IXSCAN
{...} {...} {...} {...} {...} {...} {...} {...} {...}
{

		"queryPlanner":	{

				"winningPlan":	{

						"stage":	"SORT",

						"sortPattern":	{

								"pop":	-1

						},

						"inputStage":	{

								"stage":	"FETCH",

								"filter":	{

										"pop":	{

												"$gt":	100000

										}

								},

								"inputStage":	{

										"stage":	"IXSCAN",

										"keyPattern":	{

												"state":	1,

												"city":	1

										},

										"indexName":	"state_1_city_1",

										"isMultiKey":	false,

										"direction":	"forward",

										"indexBounds":	{

												"state":	[

														"["NY",	"NY"]"

												],

												"city":	[

														"["NEW	YORK",	"NEW	YORK
"]"

												]

										}

								}

						}

db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,	city:1})
Compound Index on two fields
plan root
SORT
FETCH
IXSCAN
{...} {...} {...} {...} {...} {...} {...} {...} {...}
{

		"queryPlanner":	{

				"winningPlan":	{

						"stage":	"SORT",

						"sortPattern":	{

								"pop":	-1

						},

						"inputStage":	{

								"stage":	"FETCH",

								"filter":	{

										"pop":	{

												"$gt":	100000

										}

								},

								"inputStage":	{

										"stage":	"IXSCAN",

										"keyPattern":	{

												"state":	1,

												"city":	1

										},

										"indexName":	"state_1_city_1",

										"isMultiKey":	false,

										"direction":	"forward",

										"indexBounds":	{

												"state":	[

														"["NY",	"NY"]"

												],

												"city":	[

														"["NEW	YORK",	"NEW	YORK
"]"

												]

										}

								}

						}

db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,	city:1})
Compound Index on two fields
plan root
SORT
FETCH
IXSCAN
{...} {...} {...} {...} {...} {...} {...} {...} {...}
"direction":	"forward",

										"indexBounds":	{

												"state":	[

														"["NY",	"NY"]"

												],

												"city":	[

														"["NEW	YORK",	"NEW	YORK
"]"

												]

										}

								}

						}

				}

		},

		"executionStats":	{

				"executionSuccess":	true,

				"nReturned":	2,

				"executionTimeMillis":	4,

				"totalKeysExamined":	40,

				"totalDocsExamined":	40,

				"executionStages":	{

						"stage":	"SORT",

						"nReturned":	2,

						"executionTimeMillisEstimate":	4,

						"works":	45,

						"advanced":	2,

						"needTime":	41,

						"needFetch":	0,

						"saveState":	0,

						"restoreState":	0,

						"isEOF":	1,

						"invalidates":	0,

						"sortPattern":	{

								"pop":	-1

db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,	city:1})
Compound Index on two fields
plan root
SORT
FETCH
IXSCAN
{...} {...} {...} {...} {...} {...} {...} {...} {...}
"direction":	"forward",

										"indexBounds":	{

												"state":	[

														"["NY",	"NY"]"

												],

												"city":	[

														"["NEW	YORK",	"NEW	YORK
"]"

												]

										}

								}

						}

				}

		},

		"executionStats":	{

				"executionSuccess":	true,

				"nReturned":	2,

				"executionTimeMillis":	4,

				"totalKeysExamined":	40,

				"totalDocsExamined":	40,

				"executionStages":	{

						"stage":	"SORT",

						"nReturned":	2,

						"executionTimeMillisEstimate":	4,

						"works":	45,

						"advanced":	2,

						"needTime":	41,

						"needFetch":	0,

						"saveState":	0,

						"restoreState":	0,

						"isEOF":	1,

						"invalidates":	0,

						"sortPattern":	{

								"pop":	-1

db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,	city:1})
Compound Index on two fields
plan root
SORT
FETCH
IXSCAN
{...} {...} {...} {...} {...} {...} {...} {...} {...}
2 documents returned
"direction":	"forward",

										"indexBounds":	{

												"state":	[

														"["NY",	"NY"]"

												],

												"city":	[

														"["NEW	YORK",	"NEW	YORK
"]"

												]

										}

								}

						}

				}

		},

		"executionStats":	{

				"executionSuccess":	true,

				"nReturned":	2,

				"executionTimeMillis":	4,

				"totalKeysExamined":	40,

				"totalDocsExamined":	40,

				"executionStages":	{

						"stage":	"SORT",

						"nReturned":	2,

						"executionTimeMillisEstimate":	4,

						"works":	45,

						"advanced":	2,

						"needTime":	41,

						"needFetch":	0,

						"saveState":	0,

						"restoreState":	0,

						"isEOF":	1,

						"invalidates":	0,

						"sortPattern":	{

								"pop":	-1

db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,	city:1})
Compound Index on two fields
plan root
SORT
FETCH
IXSCAN
{...} {...} {...} {...} {...} {...} {...} {...} {...}
2 documents returned
40 index entries scanned
"direction":	"forward",

										"indexBounds":	{

												"state":	[

														"["NY",	"NY"]"

												],

												"city":	[

														"["NEW	YORK",	"NEW	YORK
"]"

												]

										}

								}

						}

				}

		},

		"executionStats":	{

				"executionSuccess":	true,

				"nReturned":	2,

				"executionTimeMillis":	4,

				"totalKeysExamined":	40,

				"totalDocsExamined":	40,

				"executionStages":	{

						"stage":	"SORT",

						"nReturned":	2,

						"executionTimeMillisEstimate":	4,

						"works":	45,

						"advanced":	2,

						"needTime":	41,

						"needFetch":	0,

						"saveState":	0,

						"restoreState":	0,

						"isEOF":	1,

						"invalidates":	0,

						"sortPattern":	{

								"pop":	-1

db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,	city:1})
Compound Index on two fields
plan root
SORT
FETCH
IXSCAN
{...} {...} {...} {...} {...} {...} {...} {...} {...}
2 documents returned
40 documents scanned
40 index entries scanned
"direction":	"forward",

										"indexBounds":	{

												"state":	[

														"["NY",	"NY"]"

												],

												"city":	[

														"["NEW	YORK",	"NEW	YORK
"]"

												]

										}

								}

						}

				}

		},

		"executionStats":	{

				"executionSuccess":	true,

				"nReturned":	2,

				"executionTimeMillis":	4,

				"totalKeysExamined":	40,

				"totalDocsExamined":	40,

				"executionStages":	{

						"stage":	"SORT",

						"nReturned":	2,

						"executionTimeMillisEstimate":	4,

						"works":	45,

						"advanced":	2,

						"needTime":	41,

						"needFetch":	0,

						"saveState":	0,

						"restoreState":	0,

						"isEOF":	1,

						"invalidates":	0,

						"sortPattern":	{

								"pop":	-1

db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,	city:1})
Compound Index on two fields
plan root
SORT
FETCH
IXSCAN
{...} {...} {...} {...} {...} {...} {...} {...} {...}
2 documents returned
40 documents scanned
40 index entries scanned
In-Memory Sort!
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	57385,		"zip"	:	"10023",	"loc"	:	[	-73.982652,	40.77638	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	51224,		"zip"	:	"10003",	"loc"	:	[	-73.989223,	40.731253	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	46560,		"zip"	:	"10011",	"loc"	:	[	-73.99963,	40.740225	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	36602,		"zip"	:	"10019",	"loc"	:	[	-73.985834,	40.765069	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	28453,		"zip"	:	"10026",	"loc"	:	[	-73.953069,	40.801942	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	26365,		"zip"	:	"10012",	"loc"	:	[	-73.998284,	40.72553	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	106564,	"zip"	:	"10021",	"loc"	:	[	-73.958805,	40.768476	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	18913,		"zip"	:	"10001",	"loc"	:	[	-73.996705,	40.74838	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	84143,		"zip"	:	"10002",	"loc"	:	[	-73.987681,	40.715231	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	12465,		"zip"	:	"10017",	"loc"	:	[	-73.970661,	40.75172	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	100027,	"zip"	:	"10025",	"loc"	:	[	-73.968312,	40.797466	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	4834,			"zip"	:	"10018",	"loc"	:	[	-73.992503,	40.754713	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",	"pop"	:	393,				"zip"	:	"10020",	"loc"	:	[	-73.982347,	40.759729	]	}	
ABERDEENOH
NEW YORKNYNEW YORKNYW YORK NEW YORKNY NEWARKNY
NEW YORKNY NEWARKNY
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1})
db.zips.createIndex({state:1,	city:1})
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,city:1,pop:1})
Compound Index on three fields
{

		"queryPlanner":	{

				"winningPlan":	{

						"stage":	"FETCH",

						"inputStage":	{

								"stage":	"IXSCAN",

								"keyPattern":	{

										"state":	1,

										"city":	1,

										"pop":	1

								},

								"indexName":	"state_1_city_1_pop_1",

								"isMultiKey":	false,

								"direction":	"backward",

								"indexBounds":	{

										"state":	[

												"["NY",	"NY"]"

										],

										"city":	[

												"["NEW	YORK",	"NEW	YORK"]"

db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,city:1,pop:1})
Compound Index on three fields
{

		"queryPlanner":	{

				"winningPlan":	{

						"stage":	"FETCH",

						"inputStage":	{

								"stage":	"IXSCAN",

								"keyPattern":	{

										"state":	1,

										"city":	1,

										"pop":	1

								},

								"indexName":	"state_1_city_1_pop_1",

								"isMultiKey":	false,

								"direction":	"backward",

								"indexBounds":	{

										"state":	[

												"["NY",	"NY"]"

										],

										"city":	[

												"["NEW	YORK",	"NEW	YORK"]"

IXSCAN
FETCH
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,city:1,pop:1})
Compound Index on three fields
plan root
{...} {...} {...} {...} {...} {...} {...} {...} {...}
{

		"queryPlanner":	{

				"winningPlan":	{

						"stage":	"FETCH",

						"inputStage":	{

								"stage":	"IXSCAN",

								"keyPattern":	{

										"state":	1,

										"city":	1,

										"pop":	1

								},

								"indexName":	"state_1_city_1_pop_1",

								"isMultiKey":	false,

								"direction":	"backward",

								"indexBounds":	{

										"state":	[

												"["NY",	"NY"]"

										],

										"city":	[

												"["NEW	YORK",	"NEW	YORK"]"

										],

										"pop":	[

												"[inf.0,	100000.0)"

										]

								}

IXSCAN
FETCH
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,city:1,pop:1})
Compound Index on three fields
plan root
{...} {...} {...} {...} {...} {...} {...} {...} {...}
{

		"queryPlanner":	{

				"winningPlan":	{

						"stage":	"FETCH",

						"inputStage":	{

								"stage":	"IXSCAN",

								"keyPattern":	{

										"state":	1,

										"city":	1,

										"pop":	1

								},

								"indexName":	"state_1_city_1_pop_1",

								"isMultiKey":	false,

								"direction":	"backward",

								"indexBounds":	{

										"state":	[

												"["NY",	"NY"]"

										],

										"city":	[

												"["NEW	YORK",	"NEW	YORK"]"

										],

										"pop":	[

												"[inf.0,	100000.0)"

										]

								}

IXSCAN
FETCH
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,city:1,pop:1})
Compound Index on three fields
plan root
{...} {...} {...} {...} {...} {...} {...} {...} {...}?
{

		"queryPlanner":	{

				"winningPlan":	{

						"stage":	"FETCH",

						"inputStage":	{

								"stage":	"IXSCAN",

								"keyPattern":	{

										"state":	1,

										"city":	1,

										"pop":	1

								},

								"indexName":	"state_1_city_1_pop_1",

								"isMultiKey":	false,

								"direction":	"backward",

								"indexBounds":	{

										"state":	[

												"["NY",	"NY"]"

										],

										"city":	[

												"["NEW	YORK",	"NEW	YORK"]"

										],

										"pop":	[

												"[inf.0,	100000.0)"

										]

								}

IXSCAN
FETCH
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,city:1,pop:1})
Compound Index on three fields
plan root
{...} {...} {...} {...} {...} {...} {...} {...} {...}?
"indexBounds":	{

										"state":	[

												"["NY",	"NY"]"

										],

										"city":	[

												"["NEW	YORK",	"NEW	YORK"]"

										],

										"pop":	[

												"[inf.0,	100000.0)"

										]

								}

						}

				}

		},

		"executionStats":	{

				"executionSuccess":	true,

				"nReturned":	2,

				"executionTimeMillis":	2,

				"totalKeysExamined":	2,

				"totalDocsExamined":	2,

				"executionStages":	{

						"stage":	"FETCH",

						"nReturned":	2,

						"executionTimeMillisEstimate":	1,

						"works":	3,

						"advanced":	2,

						"needTime":	0,

						"needFetch":	0,

						"saveState":	0,

						"restoreState":	0,

						"isEOF":	1,

						"invalidates":	0,

						"docsExamined":	2,

						"alreadyHasObj":	0,

IXSCAN
FETCH
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,city:1,pop:1})
Compound Index on three fields
plan root
{...} {...} {...} {...} {...} {...} {...} {...} {...}
"indexBounds":	{

										"state":	[

												"["NY",	"NY"]"

										],

										"city":	[

												"["NEW	YORK",	"NEW	YORK"]"

										],

										"pop":	[

												"[inf.0,	100000.0)"

										]

								}

						}

				}

		},

		"executionStats":	{

				"executionSuccess":	true,

				"nReturned":	2,

				"executionTimeMillis":	2,

				"totalKeysExamined":	2,

				"totalDocsExamined":	2,

				"executionStages":	{

						"stage":	"FETCH",

						"nReturned":	2,

						"executionTimeMillisEstimate":	1,

						"works":	3,

						"advanced":	2,

						"needTime":	0,

						"needFetch":	0,

						"saveState":	0,

						"restoreState":	0,

						"isEOF":	1,

						"invalidates":	0,

						"docsExamined":	2,

						"alreadyHasObj":	0,

IXSCAN
FETCH
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,city:1,pop:1})
Compound Index on three fields
plan root
{...} {...} {...} {...} {...} {...} {...} {...} {...}
2 documents returned
"indexBounds":	{

										"state":	[

												"["NY",	"NY"]"

										],

										"city":	[

												"["NEW	YORK",	"NEW	YORK"]"

										],

										"pop":	[

												"[inf.0,	100000.0)"

										]

								}

						}

				}

		},

		"executionStats":	{

				"executionSuccess":	true,

				"nReturned":	2,

				"executionTimeMillis":	2,

				"totalKeysExamined":	2,

				"totalDocsExamined":	2,

				"executionStages":	{

						"stage":	"FETCH",

						"nReturned":	2,

						"executionTimeMillisEstimate":	1,

						"works":	3,

						"advanced":	2,

						"needTime":	0,

						"needFetch":	0,

						"saveState":	0,

						"restoreState":	0,

						"isEOF":	1,

						"invalidates":	0,

						"docsExamined":	2,

						"alreadyHasObj":	0,

IXSCAN
FETCH
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,city:1,pop:1})
Compound Index on three fields
plan root
{...} {...} {...} {...} {...} {...} {...} {...} {...}
2 documents returned
2 index entries scanned
"indexBounds":	{

										"state":	[

												"["NY",	"NY"]"

										],

										"city":	[

												"["NEW	YORK",	"NEW	YORK"]"

										],

										"pop":	[

												"[inf.0,	100000.0)"

										]

								}

						}

				}

		},

		"executionStats":	{

				"executionSuccess":	true,

				"nReturned":	2,

				"executionTimeMillis":	2,

				"totalKeysExamined":	2,

				"totalDocsExamined":	2,

				"executionStages":	{

						"stage":	"FETCH",

						"nReturned":	2,

						"executionTimeMillisEstimate":	1,

						"works":	3,

						"advanced":	2,

						"needTime":	0,

						"needFetch":	0,

						"saveState":	0,

						"restoreState":	0,

						"isEOF":	1,

						"invalidates":	0,

						"docsExamined":	2,

						"alreadyHasObj":	0,

IXSCAN
FETCH
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,city:1,pop:1})
Compound Index on three fields
plan root
{...} {...} {...} {...} {...} {...} {...} {...} {...}
2 documents returned
2 documents scanned
2 index entries scanned
"indexBounds":	{

										"state":	[

												"["NY",	"NY"]"

										],

										"city":	[

												"["NEW	YORK",	"NEW	YORK"]"

										],

										"pop":	[

												"[inf.0,	100000.0)"

										]

								}

						}

				}

		},

		"executionStats":	{

				"executionSuccess":	true,

				"nReturned":	2,

				"executionTimeMillis":	2,

				"totalKeysExamined":	2,

				"totalDocsExamined":	2,

				"executionStages":	{

						"stage":	"FETCH",

						"nReturned":	2,

						"executionTimeMillisEstimate":	1,

						"works":	3,

						"advanced":	2,

						"needTime":	0,

						"needFetch":	0,

						"saveState":	0,

						"restoreState":	0,

						"isEOF":	1,

						"invalidates":	0,

						"docsExamined":	2,

						"alreadyHasObj":	0,

IXSCAN
FETCH
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1}).explain("executionStats")
db.zips.createIndex({state:1,city:1,pop:1})
Compound Index on three fields
plan root
{...} {...} {...} {...} {...} {...} {...} {...} {...}
2 documents returned
2 documents scanned
2 index entries scanned
Index used for Sorting!
NEW YORKNY 106564NEW YORKNY 100027NEW YORKNY 8414374643
NEW YORKNY 51224 NEWARKNY
ADENAOH
{	"state"	:	"NY",		"city"	:	"NEW	YORK",		"pop"	:	106564,	"zip"	:	"10021",	"loc"	:	[	-73.958805,	40.768476	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",		"pop"	:	100027,	"zip"	:	"10025",	"loc"	:	[	-73.968312,	40.797466	]	}
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1})
db.zips.createIndex({state:1,city:1,pop:1})
"direction":	"backward",

"indexBounds":	{

		“state":	"["NY",	"NY"]",

		"city":"["NEW	YORK",	"NEW	YORK"]",

		"pop":"[inf.0,	100000.0)"
NEW YORKNY 106564NEW YORKNY 100027NEW YORKNY 8414374643
NEW YORKNY 51224 NEWARKNY
ADENAOH
{	"state"	:	"NY",		"city"	:	"NEW	YORK",		"pop"	:	106564,	"zip"	:	"10021",	"loc"	:	[	-73.958805,	40.768476	]	}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",		"pop"	:	100027,	"zip"	:	"10025",	"loc"	:	[	-73.968312,	40.797466	]	}
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1})
db.zips.createIndex({state:1,city:1,pop:1})
"direction":	"backward",

"indexBounds":	{

		“state":	"["NY",	"NY"]",

		"city":"["NEW	YORK",	"NEW	YORK"]",

		"pop":"[inf.0,	100000.0)"
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}})	
							.sort({pop:-1})
Projection on Index-only Data
db.zips.createIndex({state:1,city:1,pop:1})
{"zip" : "10021", "city" : "NEW YORK", "pop" : 106564, "state" : "NY" }
{"zip" : "10025", "city" : "NEW YORK", "pop" : 100027, "state" : "NY" }
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}},	
													{state:1,	city:1,	pop:1})	
							.sort({pop:-1})
Projection on Index-only Data
db.zips.createIndex({state:1,city:1,pop:1})
{"state" : "NY", "city" : "NEW YORK", "pop" : 106564 }
{"state" : "NY", "city" : "NEW YORK", "pop" : 100027 }
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}},	
													{state:1,	city:1,	pop:1})	
							.sort({pop:-1}).explain("executionStats")
Projection on Index-only Data
db.zips.createIndex({state:1,city:1,pop:1})
{	
		"queryPlanner":	{	
				"winningPlan":	{	
						"stage":	"PROJECTION",	
						"transformBy":	{	
								"state":	1,	
								"city":	1,	
								"pop":	1,	
								"zip":	0	
						},	
						"inputStage":	{	
								"stage":	"IXSCAN",	
								"keyPattern":	{	
										"state":	1,	
										"city":	1,	
										"pop":	1	
								},	
								"indexName":	"state_1_city_1_pop_1",	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}},	
													{state:1,	city:1,	pop:1})	
							.sort({pop:-1}).explain("executionStats")
Projection on Index-only Data
db.zips.createIndex({state:1,city:1,pop:1})
{	
		"queryPlanner":	{	
				"winningPlan":	{	
						"stage":	"PROJECTION",	
						"transformBy":	{	
								"state":	1,	
								"city":	1,	
								"pop":	1,	
								"zip":	0	
						},	
						"inputStage":	{	
								"stage":	"IXSCAN",	
								"keyPattern":	{	
										"state":	1,	
										"city":	1,	
										"pop":	1	
								},	
								"indexName":	"state_1_city_1_pop_1",	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}},	
													{state:1,	city:1,	pop:1})	
							.sort({pop:-1}).explain("executionStats")
Projection on Index-only Data
db.zips.createIndex({state:1,city:1,pop:1})
IXSCAN
PROJECTION
plan root
"isMultiKey":	false,	
								"direction":	"backward",	
								"indexBounds":	{	
										"state":	[	
												"["NY",	"NY"]"	
										],	
										"city":	[	
												"["NEW	YORK",	"NEW	YORK"]"	
										],	
										"pop":	[	
												"[inf.0,	100000.0)"	
										]	
								}	
						}	
				}	
		},	
		"executionStats":	{	
				"executionSuccess":	true,	
				"nReturned":	2,	
				"executionTimeMillis":	0,	
				"totalKeysExamined":	2,	
				"totalDocsExamined":	0,	
				"executionStages":	{	
						"stage":	"PROJECTION",	
						"nReturned":	2,	
						"executionTimeMillisEstimate":	0,	
						"works":	3,	
						"advanced":	2,	
						"needTime":	0,	
						"needFetch":	0,	
						"saveState":	0,	
						"restoreState":	0,	
						"isEOF":	1,	
						"invalidates":	0,	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}},	
													{state:1,	city:1,	pop:1})	
							.sort({pop:-1}).explain("executionStats")
Projection on Index-only Data
db.zips.createIndex({state:1,city:1,pop:1})
IXSCAN
PROJECTION
plan root
"isMultiKey":	false,	
								"direction":	"backward",	
								"indexBounds":	{	
										"state":	[	
												"["NY",	"NY"]"	
										],	
										"city":	[	
												"["NEW	YORK",	"NEW	YORK"]"	
										],	
										"pop":	[	
												"[inf.0,	100000.0)"	
										]	
								}	
						}	
				}	
		},	
		"executionStats":	{	
				"executionSuccess":	true,	
				"nReturned":	2,	
				"executionTimeMillis":	0,	
				"totalKeysExamined":	2,	
				"totalDocsExamined":	0,	
				"executionStages":	{	
						"stage":	"PROJECTION",	
						"nReturned":	2,	
						"executionTimeMillisEstimate":	0,	
						"works":	3,	
						"advanced":	2,	
						"needTime":	0,	
						"needFetch":	0,	
						"saveState":	0,	
						"restoreState":	0,	
						"isEOF":	1,	
						"invalidates":	0,	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}},	
													{state:1,	city:1,	pop:1})	
							.sort({pop:-1}).explain("executionStats")
Projection on Index-only Data
db.zips.createIndex({state:1,city:1,pop:1})
IXSCAN
PROJECTION
plan root 2 documents returned
"isMultiKey":	false,	
								"direction":	"backward",	
								"indexBounds":	{	
										"state":	[	
												"["NY",	"NY"]"	
										],	
										"city":	[	
												"["NEW	YORK",	"NEW	YORK"]"	
										],	
										"pop":	[	
												"[inf.0,	100000.0)"	
										]	
								}	
						}	
				}	
		},	
		"executionStats":	{	
				"executionSuccess":	true,	
				"nReturned":	2,	
				"executionTimeMillis":	0,	
				"totalKeysExamined":	2,	
				"totalDocsExamined":	0,	
				"executionStages":	{	
						"stage":	"PROJECTION",	
						"nReturned":	2,	
						"executionTimeMillisEstimate":	0,	
						"works":	3,	
						"advanced":	2,	
						"needTime":	0,	
						"needFetch":	0,	
						"saveState":	0,	
						"restoreState":	0,	
						"isEOF":	1,	
						"invalidates":	0,	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}},	
													{state:1,	city:1,	pop:1})	
							.sort({pop:-1}).explain("executionStats")
Projection on Index-only Data
db.zips.createIndex({state:1,city:1,pop:1})
IXSCAN
PROJECTION
plan root 2 documents returned
2 index entries scanned
"isMultiKey":	false,	
								"direction":	"backward",	
								"indexBounds":	{	
										"state":	[	
												"["NY",	"NY"]"	
										],	
										"city":	[	
												"["NEW	YORK",	"NEW	YORK"]"	
										],	
										"pop":	[	
												"[inf.0,	100000.0)"	
										]	
								}	
						}	
				}	
		},	
		"executionStats":	{	
				"executionSuccess":	true,	
				"nReturned":	2,	
				"executionTimeMillis":	0,	
				"totalKeysExamined":	2,	
				"totalDocsExamined":	0,	
				"executionStages":	{	
						"stage":	"PROJECTION",	
						"nReturned":	2,	
						"executionTimeMillisEstimate":	0,	
						"works":	3,	
						"advanced":	2,	
						"needTime":	0,	
						"needFetch":	0,	
						"saveState":	0,	
						"restoreState":	0,	
						"isEOF":	1,	
						"invalidates":	0,	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}},	
													{state:1,	city:1,	pop:1})	
							.sort({pop:-1}).explain("executionStats")
Projection on Index-only Data
db.zips.createIndex({state:1,city:1,pop:1})
IXSCAN
PROJECTION
plan root 2 documents returned
0 documents scanned
2 index entries scanned
"isMultiKey":	false,	
								"direction":	"backward",	
								"indexBounds":	{	
										"state":	[	
												"["NY",	"NY"]"	
										],	
										"city":	[	
												"["NEW	YORK",	"NEW	YORK"]"	
										],	
										"pop":	[	
												"[inf.0,	100000.0)"	
										]	
								}	
						}	
				}	
		},	
		"executionStats":	{	
				"executionSuccess":	true,	
				"nReturned":	2,	
				"executionTimeMillis":	0,	
				"totalKeysExamined":	2,	
				"totalDocsExamined":	0,	
				"executionStages":	{	
						"stage":	"PROJECTION",	
						"nReturned":	2,	
						"executionTimeMillisEstimate":	0,	
						"works":	3,	
						"advanced":	2,	
						"needTime":	0,	
						"needFetch":	0,	
						"saveState":	0,	
						"restoreState":	0,	
						"isEOF":	1,	
						"invalidates":	0,	
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}},	
													{state:1,	city:1,	pop:1})	
							.sort({pop:-1}).explain("executionStats")
Projection on Index-only Data
db.zips.createIndex({state:1,city:1,pop:1})
IXSCAN
PROJECTION
plan root 2 documents returned
0 documents scanned
2 index entries scanned
"Covered Query "
NEW YORKNY 106564NEW YORKNY 100027NEW YORKNY 8414374643
NEW YORKNY 51224 NEWARKNY
ADENAOH
{	"state"	:	"NY",		"city"	:	"NEW	YORK",		"pop"	:	106564}	
{	"state"	:	"NY",		"city"	:	"NEW	YORK",		"pop"	:	100027}
db.zips.createIndex({state:1,city:1,pop:1})
db.zips.find({state:'NY',city:'NEW	YORK',pop:{'$gt':100000}},	
													{state:1,	city:1,	pop:1})	
							.sort({pop:-1})
Runtime (ms) Speedup
No Index 80.155 Baseline
Compound Index 126 400
Covered Query 40 2.000
Benchmark Results
Standalone	MongoDB	v3.2.0-rc1,	WiredTiger	(12	GB	Cache	Size	and	snappy	block	compressor)			
Collection	Storage-size:		3	GB		
Collection	Data-size:							6	GB		
Compound-Index-Size:			1	GB			
Total-Index-Size:														2	GB
2,2	GHz	Intel	Core	i7,	16	GB	1600	MHz	DDR3,	SSD-Storage,	OS	X	10.11.1	(15B42)
100.000.000	ZIP-Code	documents	-	via	Datagenerator
Indexes are the single biggest tunable
performance factor in MongoDB
Runtime (ms) Speedup
No Index 80.155 Baseline
Compound Index 126 400
Covered Query 40 2.000
Benchmark Results
Standalone	MongoDB	v3.2.0-rc1,	WiredTiger	(12	GB	Cache	Size	and	snappy	block	compressor)			
Collection	Storage-size:		3	GB		
Collection	Data-size:							6	GB		
Compound-Index-Size:			1	GB			
Total-Index-Size:														2	GB
2,2	GHz	Intel	Core	i7,	16	GB	1600	MHz	DDR3,	SSD-Storage,	OS	X	10.11.1	(15B42)
100.000.000	ZIP-Code	documents	-	via	Datagenerator
Indexes are the single biggest tunable
performance factor in MongoDB
Runtime (ms) Speedup
No Index 80.155 Baseline
Compound Index 126 400
Covered Query 40 2.000
Benchmark Results
Collection	Storage-size:		3	GB		
Collection	Data-size:							6	GB		
Compound-Index-Size:			1	GB			
Total-Index-Size:														2	GB
But Memory Contention
can be a Showstopper…
Standalone	MongoDB	v3.2.0-rc1,	WiredTiger	(12	GB	Cache	Size	and	snappy	block	compressor)			
2,2	GHz	Intel	Core	i7,	16	GB	1600	MHz	DDR3,	SSD-Storage,	OS	X	10.11.1	(15B42)
100.000.000	ZIP-Code	documents	-	via	Datagenerator
Performance Tuning via
Memory Contention Reduction
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning
MongoDB Days UK: Indexing and Performance Tuning

More Related Content

What's hot

C++ file
C++ fileC++ file
C++ file
Mukund Trivedi
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDB
MongoDB
 
Aloha paper for cdac ccpp
Aloha paper  for  cdac ccppAloha paper  for  cdac ccpp
Aloha paper for cdac ccpp
prabhatjon
 
Distributed systems
Distributed systemsDistributed systems
Distributed systems
Sonali Parab
 
Why you should be using structured logs
Why you should be using structured logsWhy you should be using structured logs
Why you should be using structured logs
Stefan Krawczyk
 
Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)
MongoDB
 
Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)
Saket Pathak
 
Advanced pg_stat_statements: Filtering, Regression Testing & more
Advanced pg_stat_statements: Filtering, Regression Testing & moreAdvanced pg_stat_statements: Filtering, Regression Testing & more
Advanced pg_stat_statements: Filtering, Regression Testing & more
Lukas Fittl
 
C program
C programC program
C program
Komal Singh
 
Fast querying indexing for performance (4)
Fast querying   indexing for performance (4)Fast querying   indexing for performance (4)
Fast querying indexing for performance (4)
MongoDB
 
Data struture lab
Data struture labData struture lab
Data struture lab
krishnamurthy Murthy.Tt
 
MariaDB: ANALYZE for statements (lightning talk)
MariaDB:  ANALYZE for statements (lightning talk)MariaDB:  ANALYZE for statements (lightning talk)
MariaDB: ANALYZE for statements (lightning talk)
Sergey Petrunya
 
Data structure lab manual
Data structure lab manualData structure lab manual
Data structure lab manual
nikshaikh786
 
Indexing and Query Optimizer (Aaron Staple)
Indexing and Query Optimizer (Aaron Staple)Indexing and Query Optimizer (Aaron Staple)
Indexing and Query Optimizer (Aaron Staple)
MongoSF
 
Doublylinklist
DoublylinklistDoublylinklist
Doublylinklist
ritu1806
 
Data Structure Project File
Data Structure Project FileData Structure Project File
Data Structure Project File
Deyvessh kumar
 
C programs
C programsC programs
C programs
Vikram Nandini
 

What's hot (17)

C++ file
C++ fileC++ file
C++ file
 
Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDB
 
Aloha paper for cdac ccpp
Aloha paper  for  cdac ccppAloha paper  for  cdac ccpp
Aloha paper for cdac ccpp
 
Distributed systems
Distributed systemsDistributed systems
Distributed systems
 
Why you should be using structured logs
Why you should be using structured logsWhy you should be using structured logs
Why you should be using structured logs
 
Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)Indexing and Query Optimizer (Mongo Austin)
Indexing and Query Optimizer (Mongo Austin)
 
Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)Data Structure in C (Lab Programs)
Data Structure in C (Lab Programs)
 
Advanced pg_stat_statements: Filtering, Regression Testing & more
Advanced pg_stat_statements: Filtering, Regression Testing & moreAdvanced pg_stat_statements: Filtering, Regression Testing & more
Advanced pg_stat_statements: Filtering, Regression Testing & more
 
C program
C programC program
C program
 
Fast querying indexing for performance (4)
Fast querying   indexing for performance (4)Fast querying   indexing for performance (4)
Fast querying indexing for performance (4)
 
Data struture lab
Data struture labData struture lab
Data struture lab
 
MariaDB: ANALYZE for statements (lightning talk)
MariaDB:  ANALYZE for statements (lightning talk)MariaDB:  ANALYZE for statements (lightning talk)
MariaDB: ANALYZE for statements (lightning talk)
 
Data structure lab manual
Data structure lab manualData structure lab manual
Data structure lab manual
 
Indexing and Query Optimizer (Aaron Staple)
Indexing and Query Optimizer (Aaron Staple)Indexing and Query Optimizer (Aaron Staple)
Indexing and Query Optimizer (Aaron Staple)
 
Doublylinklist
DoublylinklistDoublylinklist
Doublylinklist
 
Data Structure Project File
Data Structure Project FileData Structure Project File
Data Structure Project File
 
C programs
C programsC programs
C programs
 

Similar to MongoDB Days UK: Indexing and Performance Tuning

[MongoDB.local Bengaluru 2018] Keynote
[MongoDB.local Bengaluru 2018] Keynote[MongoDB.local Bengaluru 2018] Keynote
[MongoDB.local Bengaluru 2018] Keynote
MongoDB
 
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptxSH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
MongoDB
 
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptxSH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
MongoDB
 
Realizability Analysis for Message-based Interactions Using Shared-State Proj...
Realizability Analysis for Message-based Interactions Using Shared-State Proj...Realizability Analysis for Message-based Interactions Using Shared-State Proj...
Realizability Analysis for Message-based Interactions Using Shared-State Proj...
Sylvain Hallé
 
A Brief MongoDB Intro
A Brief MongoDB IntroA Brief MongoDB Intro
A Brief MongoDB Intro
Scott Hernandez
 
R Statistics With MongoDB
R Statistics With MongoDBR Statistics With MongoDB
R Statistics With MongoDB
MongoDB
 
R statistics with mongo db
R statistics with mongo dbR statistics with mongo db
R statistics with mongo db
MongoDB
 
15CS664- Python Application Programming- Question bank 1
15CS664- Python Application Programming- Question bank 115CS664- Python Application Programming- Question bank 1
15CS664- Python Application Programming- Question bank 1
Syed Mustafa
 
Online | MongoDB Atlas on GCP Workshop
Online | MongoDB Atlas on GCP Workshop Online | MongoDB Atlas on GCP Workshop
Online | MongoDB Atlas on GCP Workshop
Natasha Wilson
 
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
MongoDB
 
(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014
(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014
(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014
Amazon Web Services
 
Performance and Security Enhancements in MongoDB's BI Connector
Performance and Security Enhancements in MongoDB's BI ConnectorPerformance and Security Enhancements in MongoDB's BI Connector
Performance and Security Enhancements in MongoDB's BI Connector
MongoDB
 
Ec2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.orgEc2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.org
annaunivedu
 
Data Analytics with MongoDB - Jane Fine
Data Analytics with MongoDB - Jane FineData Analytics with MongoDB - Jane Fine
Data Analytics with MongoDB - Jane Fine
MongoDB
 
Speeding Up Distributed Machine Learning Using Codes
Speeding Up Distributed Machine Learning Using CodesSpeeding Up Distributed Machine Learning Using Codes
Speeding Up Distributed Machine Learning Using Codes
NAVER Engineering
 
Indexing
IndexingIndexing
Indexing
Mike Dirolf
 
T5 2017 database_searching_v_upload
T5 2017 database_searching_v_uploadT5 2017 database_searching_v_upload
T5 2017 database_searching_v_upload
Prof. Wim Van Criekinge
 
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective IndexingMongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB
 
Linked Library Data in the wild
Linked Library Data in the wildLinked Library Data in the wild
Linked Library Data in the wild
Phil John
 
Mongodbinaction 100122230824-phpapp01
Mongodbinaction 100122230824-phpapp01Mongodbinaction 100122230824-phpapp01
Mongodbinaction 100122230824-phpapp01
Cevin Cheung
 

Similar to MongoDB Days UK: Indexing and Performance Tuning (20)

[MongoDB.local Bengaluru 2018] Keynote
[MongoDB.local Bengaluru 2018] Keynote[MongoDB.local Bengaluru 2018] Keynote
[MongoDB.local Bengaluru 2018] Keynote
 
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptxSH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
 
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptxSH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
SH 1 - SES 2 part 2 - Tel Aviv MDBlocal - Eliot Keynote.pptx
 
Realizability Analysis for Message-based Interactions Using Shared-State Proj...
Realizability Analysis for Message-based Interactions Using Shared-State Proj...Realizability Analysis for Message-based Interactions Using Shared-State Proj...
Realizability Analysis for Message-based Interactions Using Shared-State Proj...
 
A Brief MongoDB Intro
A Brief MongoDB IntroA Brief MongoDB Intro
A Brief MongoDB Intro
 
R Statistics With MongoDB
R Statistics With MongoDBR Statistics With MongoDB
R Statistics With MongoDB
 
R statistics with mongo db
R statistics with mongo dbR statistics with mongo db
R statistics with mongo db
 
15CS664- Python Application Programming- Question bank 1
15CS664- Python Application Programming- Question bank 115CS664- Python Application Programming- Question bank 1
15CS664- Python Application Programming- Question bank 1
 
Online | MongoDB Atlas on GCP Workshop
Online | MongoDB Atlas on GCP Workshop Online | MongoDB Atlas on GCP Workshop
Online | MongoDB Atlas on GCP Workshop
 
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
MongoDB .local Paris 2020: Tout savoir sur le moteur de recherche Full Text S...
 
(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014
(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014
(BDT203) From Zero to NoSQL Hero: Amazon DynamoDB Tutorial | AWS re:Invent 2014
 
Performance and Security Enhancements in MongoDB's BI Connector
Performance and Security Enhancements in MongoDB's BI ConnectorPerformance and Security Enhancements in MongoDB's BI Connector
Performance and Security Enhancements in MongoDB's BI Connector
 
Ec2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.orgEc2203 digital electronics questions anna university by www.annaunivedu.org
Ec2203 digital electronics questions anna university by www.annaunivedu.org
 
Data Analytics with MongoDB - Jane Fine
Data Analytics with MongoDB - Jane FineData Analytics with MongoDB - Jane Fine
Data Analytics with MongoDB - Jane Fine
 
Speeding Up Distributed Machine Learning Using Codes
Speeding Up Distributed Machine Learning Using CodesSpeeding Up Distributed Machine Learning Using Codes
Speeding Up Distributed Machine Learning Using Codes
 
Indexing
IndexingIndexing
Indexing
 
T5 2017 database_searching_v_upload
T5 2017 database_searching_v_uploadT5 2017 database_searching_v_upload
T5 2017 database_searching_v_upload
 
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective IndexingMongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
MongoDB .local Toronto 2019: Tips and Tricks for Effective Indexing
 
Linked Library Data in the wild
Linked Library Data in the wildLinked Library Data in the wild
Linked Library Data in the wild
 
Mongodbinaction 100122230824-phpapp01
Mongodbinaction 100122230824-phpapp01Mongodbinaction 100122230824-phpapp01
Mongodbinaction 100122230824-phpapp01
 

More from MongoDB

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 

More from MongoDB (20)

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Recently uploaded

20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 

Recently uploaded (20)

20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 

MongoDB Days UK: Indexing and Performance Tuning