|
Hello WPML Support Team,
We are currently experiencing performance issues related to slow database queries generated by the WPML plugin. These queries appear to significantly impact our server’s CPU utilization and overall site performance.
Below are the sample queries identified as slow:
Query 1 (Posts Translation Lookup):
SELECT wpml_translations.translation_id,
wpml_translations.element_id,
wpml_translations.language_code,
wpml_translations.source_language_code,
wpml_translations.trid,
wpml_translations.element_type
FROM wp_icl_translations wpml_translations
JOIN wp_posts p
ON wpml_translations.element_id = p.ID
AND wpml_translations.element_type = CONCAT(?, p.post_type)
JOIN wp_icl_translations tridt
ON tridt.element_type = wpml_translations.element_type
AND tridt.trid = wpml_translations.trid
WHERE tridt.element_id IN (...)
Query 2 (Taxonomy Translation Lookup):
SELECT wpml_translations.translation_id,
wpml_translations.element_id,
wpml_translations.language_code,
wpml_translations.source_language_code,
wpml_translations.trid,
wpml_translations.element_type
FROM wp_icl_translations wpml_translations
JOIN wp_term_taxonomy tax
ON wpml_translations.element_id = tax.term_taxonomy_id
AND wpml_translations.element_type = CONCAT(?, tax.taxonomy)
JOIN wp_icl_translations tridt
ON tridt.element_type = wpml_translations.element_type
AND tridt.trid = wpml_translations.trid
WHERE tridt.element_id IN (...)
Observed Behavior:
These queries are frequently executed and contribute to high CPU usage.
CPU utilization increases significantly when WPML-related features are active.
Queries involve multiple joins and dynamic CONCAT() conditions, which may be affecting indexing efficiency.
We would like to ask for your assistance in:
Identifying the root cause of these slow queries
Recommending optimizations (indexes, query improvements, or WPML settings)
Advising if this is a known issue or if there are patches/updates available
Environment Details:
Hosting: Google Cloud Platform (GCP)
OS/Image: Debian 11 (bullseye)
Machine Type: e2-standard-8 (8 vCPUs, 32 GB Memory)
CPU Platform: Intel Broadwell
Disk: 10GB (Balanced persistent disk)
Zone: asia-southeast1-a
Please let us know if you need additional logs, query traces, or access details for further investigation.
Thank you for your support.
|