I have a non-clustered index on this column (TOM
) in this table (SP_ORD_1PC_PASS
).
This query returns instantly:
SELECT MAX(TOM) FROM SP_ORD_1PC_PASS
This query also returns instantly:
SELECT MIN(TOM) FROM SP_ORD_1PC_PASS
However, this query takes 3 minutes to return:
SELECT MIN(TOM), MAX(TOM) FROM SP_ORD_1PC_PASS
Anything I try to do with TOM
column besides a single SELECT MIN
or SELECT MAX
results in very long query times.
I’ve never seen this type of behavior on an indexed column.
Other notes:
-
I rebuilt the index – no difference in results.
-
I’ve tried sorting same table by other columns that are indexed, and I have no issues.
-
If it helps, here are the index stats: