Home›Support›English Support›[Waiting for user feedback] WPML Media Translations runs SQL queries with a large performance overhead
[Waiting for user feedback] WPML Media Translations runs SQL queries with a large performance overhead
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
WordPress 6.7 has introduced a new issue that impact translations, please update WooCommerce and WPML to the latest versions before you report issues. More about this here - https://wpml.org/errata/php-error-wp-6-7-notice-function-_load_textdomain_just_in_time-was-called/
Background of the issue:
I am trying to optimize our site's performance and noticed a slow query from WPML's Media Translations feature while using MySQL slow query logging on RDS. The query is consistently flagged for performance issues. Running this query on our staging server results in a timing of 7.6 seconds. I explored potential improvements such as query result caching, improved indices, and replacing the JOIN-based query with a nested WHERE statement, which reduced the time to ~1.9 seconds.
Symptoms:
The SQL query executed by WPML Media Translations has a large performance overhead, taking 7.6 seconds to run and examining around 890k rows.
Questions:
How can I optimize the performance of WPML Media Translations SQL queries?
Can you work on optimizing WPML performance for larger sites?
I checked with our devs and there isn't much we can do without access to a copy of your website.
"We need the means of reproducing this issue. I am not aware which action exactly is doing this request.
Debugging performance issues requires at the least minimum the steps and an environment or idea of such an environment that this can be reproduced in.
So first tell me the exact steps that I can try so that I can even start tracing this, then a Duplicator will be best solution - as it is possible that either custom code or something from a 3rd party plugin is triggering this.
By "an idea of such an environment" I mean - list of possible plugins, custom code and/or themes along with number of contents.
Yes the number of contents in a mysql table play a pivotal role and a query which executes normally for 0.0001sec on a clean environment may execute for a second on an environment with a milion rows or so. It all depends on the SQL query."