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:
ALTER TABLE `Table` ADD INDEX `table_idx_itemid_listid_itemname` (`ItemID`,`ListID`,`ItemName`);
SELECT
Table.ItemID,
Table.ListID,
Table.ItemName,
convert(varchar(10),
MAX(date),
101) AS date,
COUNT(Table.ItemName) AS days_on_list
FROM
Table
GROUP BY
Table.ItemID,
Table.ListID,
Table.ItemName
HAVING
Max(date) = DATEADD('d', -1, convert(varchar(10), getdate(), 101))
AND Table.ListID = 1
ORDER BY
Table.ListID,
Table.ItemName,
COUNT(Table.ItemName)