I have the following:
CREATE TABLE Topic (
[TopicId] INT IDENTITY (1, 1) NOT NULL,
[TopicSeq] INT NOT NULL,
[SubjectId] INT NOT NULL,
[Name] NVARCHAR (50) Not NULL,
[Version] rowversion,
[ModifiedDate] [datetime] NOT NULL,
CONSTRAINT [PK_Topic] PRIMARY KEY CLUSTERED ([TopicId] ASC)
)";
I am thinking if I need to find all the Topics for a subject that this will take a long time. If I add an index for SubjectID then will this improve every query automatically and what is the best kind of index for me to add?