Tutorial by Topics: indexes

Indexes are a data structure that contains pointers to the contents of a table arranged in a specific order, to help the database optimize queries. They are similar to the index of book, where the pages (rows of the table) are indexed by their page number. Several types of indexes exist, and can be...
-- Create simple index CREATE INDEX index_name ON table_name(column_name1 [, column_name2, ...]) -- Create unique index CREATE UNIQUE INDEX index_name ON table_name(column_name1 [, column_name2, ...] -- Drop index DROP INDEX index_name ON tbl_name [algorithm_option | lock_option] ....
db.collection.createIndex({ <string field> : <1|-1 order> [, <string field> : <1|-1 order>] }); Performance Impact: Note that indexes improve read performances, but can have bad impact on write performance, as inserting a document requires updating all indexes. ...
Here I will explain different index using example, how index increase query performance, how index decrease DML performance etc

Page 1 of 1