CRITICAL
Rule Definition
Unique keys should be created for two reasons: data integrity and performance.
That's why every huge table should have a Primary Key or Unique Key constraint or Unique Index.
Remediation
Check table and if so, add primary key or unique key constraint or at least unique index.
Violation Code Sample
CREATE TABLE [Employee](
[EmployeeID] INT NOT NULL,
[Name] VARCHAR(50),
[Code] INT NOT NULL
)
GO
Fixed Code Sample
ALTER TABLE Employee ADD CONSTRAINT unique_code UNIQUE (Code)
GO
Reference
https://dotnettutorials.net/lesson/performance-improvement-using-unique-keys/
http://www.geeksengine.com/database/design/primary-key-constraint.php
https://www.ibm.com/support/knowledgecenter/SSCJDQ/com.ibm.swg.im.dashdb.admin.dbobj.doc/doc/c0061097.html
Related Technologies
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.