指定された表(または現在のユーザーのすべての表)をスキャンして、冗長索引を見つけます。冗長索引の名前および削除する索引に関するアドバイスを返します。
アクセス制御がTimesTenのインスタンスに対して有効である場合、このプロシージャには権限は必要ありません。
ttRedundantIndexCheckには、次のパラメータがあります。
パラメータ | データ型 | 説明 |
tblName | TT_Char (61) | アプリケーション表の名前。表の所有者を含めることができます。NULLまたは空の文字列を値として指定すると、現在のユーザーのすべての表の冗長索引がスキャンされます。 |
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.