Rule Definition
It is useless to have several indexes on the same column(s) or to have an index on columns already covered by a composite index.
This will not improve read performance and will decrease update/insert/delete performance because of index maintenance.
Remediation
Drop the index that are not necessary.
Violation Code Sample
-- SQL Sample
create table MyTable ( C1 int identity, C2 int)
create index MyTable_I1 on MyTable( C1)
create index MyTable_I2 on MyTable( C1)
create index MyTable_I3 on MyTable( C1, C2)
Fixed Code Sample
-- SQL Sample
create table MyTable ( C1 int identity, C2 int)
-- create index MyTable_I1 on MyTable( C1)
-- This index is useless as it is the same as MyTable_I2
-- create index MyTable_I2 on MyTable( C1)
-- This index is nearly useless as queries using C1 will be covered by the index MyTable_I3. It can then be dropped.
create index MyTable_I3 on MyTable( C1, C2)
Related Technologies
DB2 Server
Forms
PL/SQL
Microsoft T-SQL
Sybase T-SQL
DB2 z/OS
SQLScript
Technical Criterion
Efficiency - SQL and Data Handling Performance
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.