Create an Index

Learn how to create an index.

We'll cover the following...

Let’s see an example of creating an index. We want to create an index on the identity column of the customers table. Below is the command:

create index customers_identity_idx on customers (identity);

Before we actually execute that, let’s analyze its format.

Parts of the index query

  1. The command to create an index should start with create index.
  2. Then, we give the name of the index. Each index needs to have a name, which can be anything. It’s generally helpful to follow the <table_name>_<column>_idx pattern when naming
...