This query is slow without the right index:
SELECT TOP 1 * FROM Orders ORDER BY CreatedAt DESC;
✅ Correct Index
CREATE INDEX IX_Orders_CreatedAt ON Orders (CreatedAt DESC);
Result
-
Instant response
-
No table scan
Daily micro-tips for C#, SQL, performance, and scalable backend engineering.
This query is slow without the right index:
SELECT TOP 1 * FROM Orders ORDER BY CreatedAt DESC;
✅ Correct Index
CREATE INDEX IX_Orders_CreatedAt ON Orders (CreatedAt DESC);
Result
Instant response
No table scan