ttRedundantIndexCheck
このプロシージャは、指定された表(または現在のユーザーのすべての表)をスキャンして、冗長索引を見つけます。冗長索引の名前および削除する索引に関するアドバイスを返します。
必要な権限
このプロシージャには、権限は必要ありません。
TimesTen ScaleoutおよびTimesTen Classicでの使用
このプロシージャは、TimesTen Classicでサポートされています。
TimesTen Scaleoutアプリケーションでこの組込みプロシージャをコールできます。
TimesTen Scaleoutの場合、このプロシージャは、コール元の要素に対してローカルに実行されます。
構文
ttRedundantIndexCheck('tblname')
パラメータ
ttRedundantIndexCheck
には、次のパラメータがあります。
パラメータ | 型 | 説明 |
---|---|---|
|
|
アプリケーション表の名前。表の所有者を含めることができます。 表名の指定にシノニムは使用できません。 |
結果セット
ttRedundantIndexCheck
は次の結果を返します。
列 | 型 | 説明 |
---|---|---|
|
|
冗長索引の名前および削除する索引に関するアドバイス。 |
例
主キーを持つ表y
を作成します。次に、索引i
を作成します。冗長索引が作成されているという警告が返されます。別の索引i1
を作成します。コマンドは失敗し、エラーが返されます。このプロシージャをコールして、警告を表示します。
CREATE TABLE y (ID tt_integer primary key); CREATE INDEX i ON y (id); Warning 2240: New non-unique index I has the same key columns as existing unique index Y; consider dropping index I CREATE INDEX i1 ON y (id); 2231: New index I1 would be identical to existing index I The command failed. CALL ttredundantindexcheck ('y'); < Non-unique index SCOTT.Y.I has the same key columns as unique index SCOTT.Y.Y; consider dropping index SCOTT.Y.I > 1 row found.