admin管理员组文章数量:1122832
I am working on a website csol.cz where the search takes 5-20 seconds depending on the length of the query and whether it has special characters.
The server is a VPS with two CPU cores and 8 GB RAM, running Debian 12.
I have tried both page cache via WP Fastest Cache and object cache via Redis Object Cache - both separately and together (the latter being recommended on the Fastest Cache forums).
I have tried using the Relevanssi plugin to improve the search. I have tried adding high-performance keys (database indexes) using the Index WP MySQL For Speed plugin. I have tried cleaning up the database with the Advanced Database Cleaner plugin.
The Query monitor plugin does show several SQL queries which take several seconds to complete. When I run these queries directly from the command line, they are just as slow as when the search is performed on the front end.
Example:
SELECT COUNT(DISTINCT(relevanssi.doc))
FROM wp_relevanssi AS relevanssi
WHERE (relevanssi.term LIKE 'druha%'
OR relevanssi.term_reverse LIKE CONCAT(REVERSE('druha'), '%'))
The wp_posts table has ca. 150.000 records, wp_postmeta has ca. 20 million records. Each item has over 70 custom fields. Is there a way to speed up the search with this size of the database? Thank you very much.
本文标签: mysqlSlow search queries with a large database
版权声明:本文标题:mysql - Slow search queries with a large database 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736299125a1930381.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论