I have a table MY_TABLE
with approximately 9 million rows.
There are in total of 38 columns in this table. The columns that are relevant to my question are:
RECORD_ID
: identity, bigint, with unique clustered indexRECORD_CREATED
: datetime, with non-unique & non-clustered index
Now I run the following two queries and naturally expect the first one to execute faster because the data is being sorted by a column that has a unique clustered index but somehow it executes 271 times(!) slower.
SELECT TOP 1
RECORD_ID
FROM
MY_TABLE
WHERE
RECORD_CREATED >= '20140801'
ORDER BY
RECORD_ID
SELECT TOP 1
RECORD_ID
FROM
MY_TABLE
WHERE
RECORD_CREATED >= '20140801'
ORDER BY
RECORD_CREATED
The execution times are 1630 ms and 6 ms, respectively.
Please advise.
P.S.: Due to security policies of the environment I cannot see the execution plan or use SQL Profiler
.