Your SlideShare is downloading. ×
0
Performance Optimization Strategies for MongoDB    choosing right database server hardware    schema design (denormalizi...
What are indexes?
Chemist Drawer
Indexing = technique used to     make search faster
Computer Science definition  Index = any data structure thatimproves the performance of lookup.
DB Index datastructures  Binary Tree  B+ Tree  Balanced Tree  Hashes
Binary Search Tree
Our Favourite Employee Table
Search By Employee Idselect * from employee where employee_id= 3
B+ Tree    The B-tree is a generalization of a binary    search tree in that a node can have more than    two children  ...
A database index improves dataretrieval operations but they come up            with the cost.  slower writes and the use o...
INDEX CARDINALITY    Cardinality: Unique values in the    column
MONGO DOCUMENT{    employee_id : 8    Name : “john”    Salary : 2000}{    employee_id : 5    Name : “james”    Salary : 30...
TAKE AWAY...    Index Datastructure    Index Cardinality    Indexing is not the only solution to improve the    perform...
Points to consider while creating                 index    Keys (columns) frequently involved in search    conditions of ...
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Mongo Performance Optimization Using Indexing
Upcoming SlideShare
Loading in...5
×

Mongo Performance Optimization Using Indexing

629

Published on

Mongo Performance Optimization Using Indexing

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
629
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
13
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "Mongo Performance Optimization Using Indexing"

  1. 1. Performance Optimization Strategies for MongoDB choosing right database server hardware schema design (denormalizing schema) query optimization ($in, $nin) Indexing choosing approapriate shard key in shardingclusters
  2. 2. What are indexes?
  3. 3. Chemist Drawer
  4. 4. Indexing = technique used to make search faster
  5. 5. Computer Science definition Index = any data structure thatimproves the performance of lookup.
  6. 6. DB Index datastructures Binary Tree B+ Tree Balanced Tree Hashes
  7. 7. Binary Search Tree
  8. 8. Our Favourite Employee Table
  9. 9. Search By Employee Idselect * from employee where employee_id= 3
  10. 10. B+ Tree The B-tree is a generalization of a binary search tree in that a node can have more than two children Order of B-Tree= max no of child nodes The left subtree of a node contains only nodes with keys less than the nodes key. he right subtree of a node contains only nodes with keys greater than the nodes key.
  11. 11. A database index improves dataretrieval operations but they come up with the cost. slower writes and the use of more storage space. 3 Gigabytes of collection, if you have 1 index, approx it uses 500 Mb for that index
  12. 12. INDEX CARDINALITY Cardinality: Unique values in the column
  13. 13. MONGO DOCUMENT{ employee_id : 8 Name : “john” Salary : 2000}{ employee_id : 5 Name : “james” Salary : 3000}
  14. 14. TAKE AWAY... Index Datastructure Index Cardinality Indexing is not the only solution to improve the performance
  15. 15. Points to consider while creating index Keys (columns) frequently involved in search conditions of a queryIndexes can be created on Array, Sub- documents and also Embedded Fields Use Indexes to Sort Query Results Queries that return a range of values using operators such as $gt,$lt Negation: Inequality queries are inefficient with respect to indexes
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×