The DELETE_INDEX_STATS procedure is used to drop index statistics.
Syntax
DBMS_STATS.DELETE_INDEX_STATS (
ownname VARCHAR2,
indname VARCHAR2,
partname VARCHAR2 DEFAULT NULL,
cascade_parts BOOLEAN DEFAULT TRUE,
no_invalidate BOOLEAN DEFAULT FALSE,
force BOOLEAN DEFAULT FALSE,
tabname VARCHAR2 DEFAULT NULL);
Parameters
Parameter |
Explanation |
|---|---|
| ownname | Username. If the username is set to NULL, the current login username will be used by default. |
| indname | Index name. |
| partname | Partition name. |
| cascade_parts | If the index is partitioned and partname is NULL, set this parameter to TRUE This will delete the statistics for this index from all underlying partitions. Default is TRUE. |
| no_invalidate | Whether to flush the plan cache during statistics collection. Valid values: TRUE Indicates that the plan cache is not flushed during statistics collection. |
| force | Whether to forcibly delete the file, ignoring the lock status. Default is FALSE. If set to TRUE, the index statistics will still be deleted. |
| tabname | Table name. |
Exceptions
Error Code |
Description |
|---|---|
| HY000 |
|
Usage instructions
To call this procedure, you must be the owner of the table. For objects in the SYS tenant, you must be the owner of the table or have the SYSDBA privilege to call this procedure.
Examples
Drops all statistics for the idx1 index on table tbl1 of user testUser01.
obclient> CALL DBMS_STATS.DELETE_INDEX_STATS('testUser01', 'idx1', tabname=>'tbl1');
Query OK, 0 rows affected
Note
The table name must be explicitly specified for OceanBase AI Database because indexes are not unique under the current user.