Indexes provide faster access to rows. Indexes can be created on any column. Usually search on a column is faster if an index exists on that column.
Indexes are faster means to access database objects. By this defination it is clear that indexes are or
should be used for performance enhancements. But this is not always true, using indexes will not always help
in improving the performance.
Indexes are always independent of the physical or logical data/objects or even the database, meaning creating
and deleting(dropping) an index will harm the data or the functionality of your code. It only affects your
performance.
Though indexes are independent they require storage space.
I always get queries from my customers that we have an index but my database doesnt use it. I have created an index but after creating it my queries are slow.
Indexes are faster means to access database objects. By this defination it is clear that indexes are or
should be used for performance enhancements. But this is not always true, using indexes will not always help
in improving the performance.
Indexes are always independent of the physical or logical data/objects or even the database, meaning creating
and deleting(dropping) an index will harm the data or the functionality of your code. It only affects your
performance.
Though indexes are independent they require storage space.
I always get queries from my customers that we have an index but my database doesnt use it. I have created an index but after creating it my queries are slow.
SYNTAX:
CREATE INDEX index_name ON table_name (column_name);
EXAMPLE:
CREATE INDEX anyname ON emp (sal);
DROPPING INDEX:
DROP INDEX anyname;
Comments