I have a query as shown below,It has clustered index on one of the columns ,[Generated_red_ident].On which columns of below mentioned query has to be non clustered index?
I can understand that the Episode_Number is a good candidate for non clustered indexing.. How about the column methd and start_date1 ?
Also,do i have to create non clustered index on all those columns in group by clause as well?
Please sugest
SELECT [ID],
[Number],
[Age],
[Start_Date],
[Pr],
[Mthd],
[Identifier],
CASE
WHEN [methd] IN ( 21, 22, 23, 24,28) THEN 'er'
END AS 'ner',
CASE
WHEN Datepart(dw, [Start_Date1]) in (1,7) THEN 'Weekend'
END AS 'weekday'
FROM [PPL_Data]
WHERE [Episode_Number] = 1
GROUP BY [ID],
[Number],
[Age],
[Start_Date],
[Pr],
[Mthd],
[Identifier]