SQL Server query takes more than 2 minutes to return 10,000 rows

asked 3 days ago7 viewsen

0

I have a SQL Server table containing approximately 15 million rows. A query using WHERE, JOIN, and ORDER BY takes more than two minutes to return about 10,000 rows. The query works correctly, but performance is very slow.

SELECT c.CustomerName, o.OrderDate, o.TotalAmount FROM Orders o INNER JOIN Customers c ON o.CustomerID = c.CustomerID WHERE o.OrderDate >= '2026-01-01' ORDER BY o.OrderDate DESC;

Environment:SQL ServerWindows Server 2022

🤖 AI diagnosis

AI-generated. Not an answer — the community below confirms or corrects it. Always verify before relying on it.

No Answers

Sign in and verify your email to post an answer.