In a SQL query, does adding "TOP 1" to
SELECT TOP 1 [values] FROM [TABLE] where [TABLE].Value = "ABC"
give me a performance increase, when I know there is only one of those records? Specifically I'm thinking about LinqToSql and the difference between the methods .Single(...)
and .First(...)
, where .First(...)
adds the TOP 1
to the generated sql.
The LinqToSql already feels slow, so I'm just trying to think of ways to make it faster.
EDIT: The [TABLE].Value
maybe a foreign key in some instances.