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

posée 3 days ago7 vuesen

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;

Environnement :SQL ServerWindows Server 2022

🤖 Diagnostic IA

Généré par IA. Ce n'est pas une réponse — la communauté ci-dessous le confirme ou le corrige. Vérifiez toujours avant de vous y fier.

Aucune réponse

Sign in and verify your email to post an answer.