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 `BeaconScan` ADD INDEX `beaconscan_idx_state_lastseen` (`State`,`LastSeen`);
SELECT
Count(dbo.BeaconScan.Id)
FROM
dbo.BeaconScan
WHERE
dbo.BeaconScan.State = 'Archived'
AND dbo.BeaconScan.LastSeen < '29 February 2020'