---
title: "DROP INDEX"
url: "https://docs.yugabyte.com/stable/api/ycql/ddl_drop_index/"
---

# DROP INDEX

Use the DROP INDEX statement to remove an index and all of its data from the database.

## Synopsis

Use the `DROP INDEX` statement to remove an index and all of its data from the database.

## Syntax

### Diagram

DROPINDEXIFEXISTS[index\_name](/stable/api/ycql/grammar_diagrams#index-name)

### Grammar

```ebnf
drop_index ::= DROP INDEX [ IF EXISTS ] index_name;
```

Where

- `index_name` is an identifier (possibly qualified with a keyspace name).

## Semantics

- An error is raised if the specified `index_name` does not exist unless `IF EXISTS` option is present.
- Associated objects to `index_name` such as prepared statements will be eventually invalidated after the drop statement is completed.

## Examples

```sql
ycqlsh:example> CREATE TABLE users(id INT PRIMARY KEY, name TEXT) WITH transactions = { 'enabled' : true };
```

```sql
ycqlsh:example> CREATE INDEX users_by_name ON users(name);
```

```sql
ycqlsh:example> DROP INDEX users_by_name;
```

## See also

- [CREATE TABLE](/stable/api/ycql/ddl_create_table "CREATE TABLE")
- [CREATE INDEX](/stable/api/ycql/ddl_create_index/ "CREATE INDEX")
