---
title: "DROP INDEX - OceanBase 数据库 V4.6.0 | OceanBase 文档中心"
description: DROP INDEX 描述 该语句用来删除表上的索引。当索引过多时，维护开销增大，因此需要删除不必要的索引。 注意 删除索引后，该索引将无法再用于优化查询性能，请谨慎操作。 删除索引不会影响表中的数据。 支持删除普通索引、唯一索引、全文索引等各类索引。 语法 DROP INDEX index_name ON tabl…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*P8CuR4UJ_FkAAAAAAAAAAAAADiGDAQ/original) OceanBase 数据库分布式版 - V 4.6.0

# DROP INDEX

更新时间：2026-05-14 20:04:25

[编辑](https://github.com/oceanbase/oceanbase-doc/edit/V4.6.0/zh-CN/700.reference/500.sql-reference/100.sql-syntax/200.common-tenant-of-mysql-mode/600.sql-statement-of-mysql-mode/3500.drop-index-of-mysql-mode.md)  

## 描述

该语句用来删除表上的索引。当索引过多时，维护开销增大，因此需要删除不必要的索引。

#### 注意

- 删除索引后，该索引将无法再用于优化查询性能，请谨慎操作。
 - 删除索引不会影响表中的数据。
 - 支持删除普通索引、唯一索引、全文索引等各类索引。

## 语法

```sql
DROP INDEX index_name ON table_name;

```

## 参数解释

| **参数** | **描述** |
| --- | --- |
| index_name | 指定要删除的索引名称。 |
| table_name | 指定索引所属的表名。 |

## 示例

- 创建表并创建索引，然后删除索引。

```sql
obclient> CREATE TABLE test(c1 INT PRIMARY KEY, c2 INT, c3 INT);
obclient> CREATE INDEX test_index ON test(c2);
obclient> SHOW INDEX FROM test;

```

查询结果如下：

```sql
+-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+
| Table | Non_unique | Key_name   | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment   | Index_comment | Visible |
+-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+
| test  |          0 | PRIMARY    |            1 | c1          | A         |        NULL | NULL     | NULL   |      | BTREE      | available |               | YES     |
| test  |          1 | test_index |            1 | c2          | A         |        NULL | NULL     | NULL   | YES  | BTREE      | available |               | YES     |
+-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+
2 rows in set

```

删除索引：

```sql
obclient> DROP INDEX test_index ON test;
obclient> SHOW INDEX FROM test;

```

查询结果如下：

```sql
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment   | Index_comment | Visible |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+
| test  |          0 | PRIMARY  |            1 | c1          | A         |        NULL | NULL     | NULL   |      | BTREE      | available |               | YES     |
+-------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+
1 row in set

```

- 删除唯一索引。删除唯一索引后，原本由该索引约束的唯一性将失效，允许插入重复值。

```sql
obclient> CREATE TABLE test(c1 INT PRIMARY KEY, c2 INT, UNIQUE INDEX idx(c2));
obclient> INSERT INTO test(c1, c2) VALUES(1, 1);
obclient> DROP INDEX idx ON test;
obclient> INSERT INTO test(c1, c2) VALUES(2, 1);

```

- 删除全文索引。

```sql
obclient> CREATE TABLE articles (
      id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
      title VARCHAR(200),
      content TEXT,
      FULLTEXT INDEX ctx(title, content)
  );
obclient> DROP INDEX ctx ON articles;

```

## 相关文档

- [CREATE INDEX](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000005686100)
 - [ALTER TABLE](https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000005686147)

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
