 <p>Try this:</p> <pre><code>SELECT SequencedChannelValue.* -- Specify only the columns you need, exclude the SequencedChannelValue FROM ( SELECT ChannelValue.*, -- Specify only the columns you need SeqValue = ROW_NUMBER() OVER(PARTITION BY VehicleID ORDER BY TimeStamp DESC) FROM ChannelValue ) AS SequencedChannelValue WHERE SequencedChannelValue.SeqValue = 1 </code></pre> <p>A table or index scan is expected, because you're not filtering data in any way. You're asking for the latest TimeStamp for all VehicleIDs - the query engine HAS to look at every row to find the latest TimeStamp.</p> <p>You can help it out by narrowing the number of columns being returned (don't use SELECT *), and by providing an index that consists of VehicleID + TimeStamp.</p>