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 `source1` ADD INDEX `source1_idx_peopleid` (`peopleid`);
SELECT
t.totvalue
FROM
totals t
INNER JOIN
(
SELECT
source1.peopleid,
sum(source1.value) AS TotValues
FROM
source1
GROUP BY
source1.peopleid
) s
ON t.peopleid = s.peopleid
WHERE
t.datasource LIKE 'source1'