There are various types of indexes that can be created using the CREATE INDEX statement. The basic syntax of a CREATE INDEX is as follows − Preferably, an index must be created on column(s) of a large table that are frequently queried for data retrieval. This statement allows you to name the index, to specify the table and which column or columns to index, and to indicate whether the index is in an ascending or descending order. The CREATE INDEX StatementĪn index in SQL can be created using the CREATE INDEX statement. Despite that, the users cannot view them physically as they are just performance tools. SQL Indexes need their own storage space within the database.
However, these indexes do not have any effect on the data. While an index speeds up the performance of data retrieval queries (SELECT statement), it slows down the performance of data input queries (UPDATE and INSERT statements). SQL Indexes work similar to the index of a book or a journal.
They hold pointers that refer to the data stored in a database, which makes it easier to locate the required data records in a database table. SQL Indexes are special lookup tables that are used to speed up the process of data retrieval.