> For the complete documentation index, see [llms.txt](https://docs.starrocks.io/llms.txt). This page is also available as Markdown at its `.md` URL.

# CREATE INDEX

Creates indexes.

You can create the following indexes:

* [Bitmap index](https://docs.starrocks.io/docs/table_design/indexes/Bitmap_index.md)
* [N-Gram bloom filter index](https://docs.starrocks.io/docs/table_design/indexes/Ngram_Bloom_Filter_Index.md)
* [Full-Text inverted index](https://docs.starrocks.io/docs/table_design/indexes/inverted_index.md)
* [Vector index](https://docs.starrocks.io/docs/table_design/indexes/vector_index.md)

For detailed instructions and examples on creating these indexes, see the corresponding tutorials listed above.

tip

This operation requires the ALTER privilege on the target table. You can follow the instructions in [GRANT](https://docs.starrocks.io/docs/sql-reference/sql-statements/account-management/GRANT.md) to grant this privilege.

## Syntax[​](#syntax "Direct link to Syntax")

```sql
CREATE INDEX index_name ON table_name (column_name) 
[USING { BITMAP | NGRAMBF | GIN | VECTOR } ] 
[(index_property)] 
[COMMENT '<comment>']

```

## Parameter[​](#parameter "Direct link to Parameter")

| **Parameter**   | **Required** | **Description**                                                                                                                                                                       |
| --------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| index_name     | Yes          | The index name. For naming conventions, see [System Limits](https://docs.starrocks.io/docs/sql-reference/System_limit.md).                                                            |
| table_name     | Yes          | The name of the table.                                                                                                                                                                |
| column_name    | Yes          | The name of the column to build index on. One column can have only one index. If a column already has an index, you cannot create one more index on it.                               |
| USING           | No           | The type of the index to create. Valid values: - BITMAP (Default)<br />- NGRAMBF<br />- GIN<br />- VECTOR                                                                             |
| index_property | No           | The properties of the index to create. For `NGRAMBF`, `GIN`, and `VECTOR`, you must specify the corresponding properties. For detailed instructions, see the corresponding tutorials. |
| COMMENT         | No           | The comment for the index.                                                                                                                                                            |

## Examples[​](#examples "Direct link to Examples")

Create a table `sales_records` as follows:

```sql
CREATE TABLE sales_records
(
    record_id int,
    seller_id int,
    item_id int
)
DISTRIBUTED BY hash(record_id)
PROPERTIES (
    "replication_num" = "3"
);

```

Create a bitmap index `index3` on the `item_id` column of `sales_records`.

```sql
CREATE INDEX index3 ON sales_records (item_id) USING BITMAP COMMENT '';

```

## Relevant SQLs[​](#relevant-sqls "Direct link to Relevant SQLs")

* [SHOW INDEX](https://docs.starrocks.io/docs/sql-reference/sql-statements/table_bucket_part_index/SHOW_INDEX.md)
* [DROP INDEX](https://docs.starrocks.io/docs/sql-reference/sql-statements/table_bucket_part_index/DROP_INDEX.md)
