SlideShare uma empresa Scribd logo
1 de 233
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

Indexing with MongoDB
Indexing with MongoDBIndexing with MongoDB
Indexing with MongoDBMongoDB
 
Aloha paper for cdac ccpp
Aloha paper  for  cdac ccppAloha paper  for  cdac ccpp
Aloha paper for cdac ccppprabhatjon
 
Distributed systems
Distributed systemsDistributed systems
Distributed systemsSonali 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 logsStefan 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 & moreLukas Fittl
 
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
 
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 manualnikshaikh786
 
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
Doublylinklistritu1806
 
Data Structure Project File
Data Structure Project FileData Structure Project File
Data Structure Project FileDeyvessh kumar
 

Mais procurados (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
 

Semelhante a 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] KeynoteMongoDB
 
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.pptxMongoDB
 
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.pptxMongoDB
 
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é
 
R statistics with mongo db
R statistics with mongo dbR statistics with mongo db
R statistics with mongo dbMongoDB
 
R Statistics With MongoDB
R Statistics With MongoDBR Statistics With MongoDB
R Statistics With MongoDBMongoDB
 
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 1Syed 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 2014Amazon 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 ConnectorMongoDB
 
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.organnaunivedu
 
Data Analytics with MongoDB - Jane Fine
Data Analytics with MongoDB - Jane FineData Analytics with MongoDB - Jane Fine
Data Analytics with MongoDB - Jane FineMongoDB
 
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 CodesNAVER Engineering
 
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 IndexingMongoDB
 
Linked Library Data in the wild
Linked Library Data in the wildLinked Library Data in the wild
Linked Library Data in the wildPhil John
 
Mongodbinaction 100122230824-phpapp01
Mongodbinaction 100122230824-phpapp01Mongodbinaction 100122230824-phpapp01
Mongodbinaction 100122230824-phpapp01Cevin Cheung
 

Semelhante a 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 mongo db
R statistics with mongo dbR statistics with mongo db
R statistics with mongo db
 
R Statistics With MongoDB
R Statistics With MongoDBR Statistics With MongoDB
R Statistics With 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
 
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
 

Mais de 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 AtlasMongoDB
 
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 MongoDBMongoDB
 
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 DataMongoDB
 
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 StartMongoDB
 
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.2MongoDB
 
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 MindsetMongoDB
 
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 JumpstartMongoDB
 
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 DiveMongoDB
 
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 & GolangMongoDB
 
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
 

Mais de 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...
 

Último

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

MongoDB Days UK: Indexing and Performance Tuning