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
Minutes = SUM(r.MinutesRead),
Pages = SUM(r.PagesRead)
FROM
(SELECT
DISTINCT r.Date,
r.UserId,
r.BookId,
r.UserGroupId
FROM
dbo.ReadingStatDaily r
WHERE
r.Date >= @p0) r0 CROSS APPLY (SELECT
TOP 1 r.MinutesRead,
r.PagesRead
FROM
dbo.ReadingStatDaily r
WHERE
r0.Date = r.Date
AND r0.UserId = r.UserId
AND r0.UserGroupId = r.UserGroupId
AND r0.BookId = r.BookId
AND r.Date >= @p0
ORDER BY
r.WordsRead DESC,
r.PagesRead DESC) r