I run a Joomla 5.2.5 site with approximately 3,500 articles.
Smart Search is enabled, and I use YOOtheme Pro as the template.
Lately, the site has been getting slower than usual, so I checked the logs and discovered that it generates over 1GB of slow query logs daily!
Smart Search runs queries like this:
Code: Select all
SELECT l.link_id, l.object,l.start_date AS ordering
FROM xj56h3_finder_links AS l
INNER JOIN `xj56h3_finder_links_terms` AS m ON m.link_id = l.link_id
WHERE `l`.`access` IN (1,5) AND l.state = 1 AND l.published = 1 AND (l.publish_start_date IS NULL OR l.publish_start_date <= '2025-03-15 20:54:00') AND (l.publish_end_date IS NULL OR l.publish_end_date >= '2025-03-15 20:54:00') AND `object` != '' AND m.term_id IN ($list1)
GROUP BY l.link_id,l.object
HAVING SUM(CASE WHEN m.term_id IN ($list2) THEN 1 ELSE 0 END) > 0 AND SUM(CASE WHEN m.term_id IN (2017763,2228629,3767504) THEN 1 ELSE 0 END) > 0;
In the database:
#__finder_terms contains 230,000 records,
#__finder_links contains 3,400 records,
#__finder_links_terms contains 1.5 million records.
We are using PHP 8.3.3 and MariaDB 10.4.22.
How can we reduce this heavy load?