As a starting point, is it better to use the surrogate identity column (SaleItemID) as the clustered index. Or look for a column that I expect will be used often when reading data from the table but it will not be unique (SalesCategoryID).
I tune the indexes as the tables grow, but I'm looking for a good starting point for my clustered index.
-- OPTION #1: clustered index on primary key (so, unique)
CREATE TABLE dbo.SaleItems
(
SaleItemID INT IDENTITY PRIMARY KEY CLUSTERED,
SalesCategoryID int NOT NULL,
SaleItemName varchar (100) NOT NULL,
SalesPrice smallmoney NULL
);
-- OPTION #2: clustered index on column that matches common filter (not unique)
CREATE TABLE dbo.SaleItems
(
SaleItemID INT IDENTITY PRIMARY KEY,
SalesCategoryID int NOT NULL,
SaleItemName varchar (100) NOT NULL,
SalesPrice smallmoney NULL
);
CREATE CLUSTERED INDEX IX_SaleItems_SalesCategoryID ON dbo.SaleItems (SalesCategoryID);