SQL Foundations  «Prev 

Syntax for SQL Indexes

Creating indexes will likely not be something that you do directly in your queries against the database. You will likely need to work with a developer, DBA, or other system administration personnel to implement a new index. Still, it is important to understand what indexes are and the fact that they are available in the first place as a line of defense.
The syntax, or how indexes are implemented, varies from database engine to database engine. For example, on some databases, the index may be stored separately from the data in your system. Other systems store the index as part of the data in your system. There may be considerations of disk space as well. Keep in mind that, if you start indexing every possible column, the disk space required to keep up with that index may be a problem on your servers.


The CREATE INDEX statement is used to create indexes in tables. Indexes allow the database application to find data fast; without reading the whole table.

Table Index

An index can be created in a table to find data more quickly and efficiently. The users cannot see the indexes, they are just used to speed up searches and queries.
Updating a table with indexes takes more time than updating a table without because the indexes also require an update. Therefore, you should only create indexes on columns and tables that will be frequently searched against.