In case you have your own slow SQL query, you can optimize it automatically here.
For the query above, the following recommendations will be helpful as part of the SQL tuning process.
You'll find 3 sections below:
SELECT
p.productid,
p.productname,
SUM(qty * od.unitprice) AS TotalAmount
FROM
Production.Products AS p
JOIN
Sales.OrderDetails AS od
ON p.productid = od.productid
WHERE
N'USA' IN (
SELECT
o.shipcountry
FROM
Sales.Orders AS o
JOIN
Sales.OrderDetails AS od
ON o.orderid = od.orderid
WHERE
o.shipcountry = N'USA'
)
GROUP BY
p.productid,
p.productname