Source: https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/drop/ Documentation version: v5.3.2 # DROP INDEX statement The DROP INDEX statement deletes an index from a specific graph or temporary graph. To specify the graph or temporary graph, use either of the following methods: - Add a [USE clause](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/dql/clauses/use-graph/) before this statement to set the working graph. - Use [SESSION SET](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/sessions/set/) to set the graph or temporary graph for the current session in advance. If both methods are used, the one specified in the USE clause takes precedence. If neither is used, an error occurs. ## Notes When a DROP INDEX statement is executed to destroy an index, the index data is not immediately physically deleted from the Storage service (disk space remains occupied). Instead, the data is permanently deleted during subsequent [RocksDB Compaction](https://github.com/facebook/rocksdb/wiki/Compaction) operations. You can manually submit a COMPACT job to force the physical deletion of the data. The actual immediate deletion depends on the current level of the data in RocksDB's LSM-tree hierarchy. Note An operation involving a non-default schema or an object in it requires access to the schema, either implicitly or through an explicit `USAGE` grant, as well as the privilege required for the operation. The schema access check and the privilege check for the requested operation are independent; satisfying one does not satisfy the other. Schema access control does not apply to temporary graphs or built-in procedures and functions. For more information, see [Schema access control](https://dev-docs.nebula-graph.io/v5.3.2/server-admin/authorization/schema-access-control/). ## Prerequisites - An index is created. For more information, see [Indexes overview](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/). - To drop an index from a graph, you must either be the owner of the graph, be granted to perform the action `INDEX` on the graph, or be granted to perform the action `DROP ANY INDEX` on the used schema. For more information, see [Roles and privileges](https://dev-docs.nebula-graph.io/v5.3.2/server-admin/authorization/). - To drop an index from a temporary graph, you must be the user with the role `ADMIN` or the owner of the temporary graph. ## Syntax diagramsource drop_index_statement ```` drop_index_statement ::= 'DROP' 'INDEX' ('IF EXISTS')? index_name ```` ## Parameters ### `IF EXISTS` This clause checks if the index to be deleted exists. If it does not exist, the index is not deleted and no exception is thrown. If you do not specify this clause, an exception is thrown if the index to be deleted does not exist. ### `index_name` The name of the index to be dropped. ## Examples ### Drop a normal index on a node type of a graph ```` USE movie DROP INDEX IF EXISTS idx_actor_age ```` The preceding example drops the index `idx_actor_age` that was created in [CREATE NORMAL INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create/). ### Drop a normal index on an edge type of a graph ```` USE movie DROP INDEX IF EXISTS idx_watch_rating ```` The preceding example drops the index `idx_watch_rating` that was created in [CREATE NORMAL INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create/). ### Drop a normal index on a node type of a temporary graph ```` USE #movie_temporary_graph DROP INDEX IF EXISTS idx_actor_age_temp ```` The preceding example drops the index `idx_actor_age_temp` that was created in [CREATE NORMAL INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create/). ### Drop a normal index on an edge type of a temporary graph ```` USE #movie_temporary_graph DROP INDEX IF EXISTS idx_watch_rating_temp ```` The preceding example drops the index `idx_watch_rating_temp` that was created in [CREATE NORMAL INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create/). ### Drop a vector index on a node type of a graph ```` USE ann_test_graph DROP INDEX IF EXISTS idx_node_vec1 ```` The preceding example drops the vector index `idx_node_vec1` that was created in [CREATE VECTOR INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create-vector/). ### Drop a vector index on an edge type of a graph ```` USE ann_test_graph DROP INDEX IF EXISTS idx_edge_vec2 ```` The preceding example drops the vector index `idx_edge_vec2` that was created in [CREATE VECTOR INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create-vector/). ### Drop a spatial index on a node type of a graph ```` USE my_graph DROP INDEX IF EXISTS idx_gnode_g ```` The preceding example drops the spatial index `idx_gnode_g` that was created in [CREATE SPATIAL INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create-geo/). ### Drop a spatial index on an edge type of a graph ```` USE my_graph DROP INDEX IF EXISTS idx_gedge_g ```` The preceding example drops the spatial index `idx_gedge_g` that was created in [CREATE SPATIAL INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create-geo/). ### Drop a full-text index on a node type of a graph ```` USE movie DROP INDEX IF EXISTS ft_movie ```` The preceding example drops the full-text index `ft_movie` that was created in [CREATE FULLTEXT INDEX](https://dev-docs.nebula-graph.io/v5.3.2/database-gql-reference/ddl/index/create-fulltext/).