- Indexes are used to search/query the data from the table, without reading the entire table.
Disadvantages:-
- updating the table with an index takes more time when compared to table without index.so,create indexes on columns only which are frequently used/queried.
CREATE INDEX index_name ON table_name (column_name1,[column_name2],[column_name3],.....)
Ex:-
- CREATE INDEX person_index ON employees (firstname)
- CREATE INDEX person_index ON employees (firstname,lastname) //If we you want to create INDEX on combination of columns
No comments:
Post a Comment