magemojo / m2-ce-cron

Magento 2 cron project to fix bugs and common cron issues.
https://magemojo.com
MIT License
165 stars 45 forks source link

SQL Performance degredation as cron_schedule grows #134

Open JesKingDev opened 1 year ago

JesKingDev commented 1 year ago

We have noticed that the performance of cron table selects by the module slows down over the course of the day until the cron table is cleared. My suspicion is that this is due to the getJobsByStatus query not specifying columns (https://github.com/magemojo/m2-ce-cron/blob/master/Model/ResourceModel/Schedule.php#L195-L199). In this case, the full table will be returned, including the text field for the schedule output.

The queries used by the cron service should remain performant, even if multiple days of jobs are in the table and if a large-ish number of jobs is running.

CleanShot 2023-02-23 at 11 03 14@2x