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 `customerdata` ADD INDEX `customerdata_idx_customer` (`customer`);
ALTER TABLE `customers` ADD INDEX `customers_idx_id` (`id`);
SELECT
c.id,
c.type,
c.name,
c.environment,
cd.customer,
MAX(cd.createdAt) AS lastUpdate
FROM
customerdata AS cd
JOIN
customers c
ON cd.customer = c.id
GROUP BY
cd.customer
ORDER BY
c.name ASC