Status(bigint) is indexed, but TimeStamp(datetime) is not indexed.
Status can be only -1, 0, and 1.
TimeStamp is the date/time the row created.
Only up to 10 rows in the table(which has millions) the status can be 1, the rest must be 0 or -1.
I only care about those rows that has status of 1.
And if i issue the following command
QUOTE
select * from table where Status=1 and DATEDIFF(Minute, getDate(), TimeStamp)<10
I want to know if the sql server will have to process and compare the whole table of million of rows, or its smart enough to filter those 10 rows from status then only compare ?
I dont have the millions of record now, and thus i need to ask =P