• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Mongo Performance Optimization Using Indexing
 

Mongo Performance Optimization Using Indexing

on

  • 568 views

Mongo Performance Optimization Using Indexing

Mongo Performance Optimization Using Indexing

Statistics

Views

Total Views
568
Views on SlideShare
568
Embed Views
0

Actions

Likes
1
Downloads
11
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Mongo Performance Optimization Using Indexing Mongo Performance Optimization Using Indexing Presentation Transcript

    • 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
    • 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 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.
    • 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
    • INDEX CARDINALITY Cardinality: Unique values in the column
    • MONGO DOCUMENT{ employee_id : 8 Name : “john” Salary : 2000}{ employee_id : 5 Name : “james” Salary : 3000}
    • TAKE AWAY... Index Datastructure Index Cardinality Indexing is not the only solution to improve the performance
    • 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