And as we venture into Joomla 4 territory, instead of seeing performance improvements (finally) for the entire database scheme, we actually witness new ways to mess up performance (if that was even possible). Apparently the Joomla core team likes to exercise who knows PHP's syntax better instead of actually building working code that doesn't break for extension developers every so.
Oh well, we're used to the mess.
Back to our topic.
Wanna improve the performance of the Joomla article system, especially in sites that filter/order content in various ways? Well, for starters add a few indices to the "content" table, e.g. using phpMyAdmin.
ALTER TABLE `#__content` ADD INDEX `idx_publishup` (`publish_up`);
ALTER TABLE `#__content` ADD INDEX `idx_publishdown` (`publish_down`);
ALTER TABLE `#__content` ADD INDEX `idx_modifiedby` (`modified_by`);
ALTER TABLE `#__content` ADD INDEX `idx_created` (`created`);
ALTER TABLE `#__content` ADD INDEX `idx_modified` (`modified`);
Just remember to replace #__ with your actual database prefix for Joomla.
But what's the measurable improvement? Well, something like this after you apply the above changes (on a really busy site that sorts articles by published date, aka 99% of Joomla sites)...
And that's performance tip no.1. We'll come back with more in the future as we delve into the software architectural wonder that is Joomla 4.
Or do yourself a favour & switch to K2 which recently passed 4 million downloads, yeah! :)
To those who might say, hey why aren't you contributing that back to Joomla, well, our answer is that if you've ever contributed in Joomla, you know the painful process & bureaucracy and you juuuust might wish to keep your sanity.
Until next time.