All Products
Search
Document Center

PURGE INDEX

Last Updated: Jun 18, 2021

Description

You can execute the PURGE INDEX statement to delete an indexed table from the recycle bin.

Syntax

 PURGE INDEX object_name;

Parameters

Parameter

Description

object_name

The name of the object in the recycle bin. After an object is moved to the recycle bin, the system generates a new name for the object.

Examples

  • Delete indexed table __recycle_$_1_1597387726700872 from the recycle bin.

OceanBase(admin@test)> create table t1(c1 int);
Query OK, 0 rows affected (0.09 sec)

OceanBase(admin@test)> create index idx on t1(c1);
Query OK, 0 rows affected (0.48 sec)

OceanBase(admin@test)> drop table t1;
Query OK, 0 rows affected (0.03 sec)

OceanBase(admin@test)> show recyclebin;
+--------------------------------+----------------------------+-------+----------------------------+
| OBJECT_NAME                    | ORIGINAL_NAME              | TYPE  | CREATETIME                 |
+--------------------------------+----------------------------+-------+----------------------------+
| __recycle_$_1_1597387726700872 | __idx_1101710651081557_idx | INDEX | 2020-08-14 14:48:46.699145 |
| __recycle_$_1_1597387726712976 | t1                         | TABLE | 2020-08-14 14:48:46.712643 |
+--------------------------------+----------------------------+-------+----------------------------+
5 rows in set (0.01 sec)

OceanBase(admin@test)> purge index __recycle_$_1_1597387726700872;
Query OK, 0 rows affected (0.04 sec)