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 `shortlink_analytics` ADD INDEX `shortlink_analytic_idx_shortlink` (`shortlink`);
ALTER TABLE `shortlinks` ADD INDEX `shortlinks_idx_shortlink` (`shortlink`);
SELECT
optimizedSub1.*,
(SELECT
shortlinks.link
FROM
shortlinks
WHERE
shortlinks.shortlink = optimizedSub1.short) AS shLink
FROM
(SELECT
shortlink_analytics.shortlink AS short,
COUNT(shortlink_analytics.shortlink) AS shortcount
FROM
shortlink_analytics
JOIN
shortlinks
ON shortlink_analytics.shortlink = shortlinks.shortlink
GROUP BY
shortlink_analytics.shortlink
ORDER BY
COUNT(shortlink_analytics.shortlink) DESC LIMIT 10) AS optimizedSub1