I have the following very large table in SQL Server 2005:
create table Blah
(
FirstName varchar(30),
Rank int,
Position int,
...
)
I will run the following query on it:
declare @PassedInFirstName varchar(30)
set @PassedInFirstName = 'SomeName'
select TOP 1 Position
from Blah
where FirstName = @PassedInFirstName
order by Rank DESC
I am setting up the following index on it:
CREATE INDEX IX_Blah ON Blah (FirstName, Rank)
Given that I order it by Rank DESC, should I change the index to order Rank in a descending way:
CREATE INDEX IX_Blah ON Blah (FirstName ASC, Rank DESC)
Or it does not matter?
Thanks.