{"id":7623,"date":"2011-05-27T09:45:54","date_gmt":"2011-05-27T09:45:54","guid":{"rendered":"http:\/\/wpml.org\/?post_type=faq&#038;p=7623"},"modified":"2023-09-06T08:35:34","modified_gmt":"2023-09-06T08:35:34","slug":"how-to-optimize-mysql-queries","status":"publish","type":"faq","link":"https:\/\/wpml.org\/it\/faq\/how-to-optimize-mysql-queries\/","title":{"rendered":"How can I optimize MySQL queries for translated pages?"},"content":{"rendered":"<p class=\"lead\">You can optimize MySQL queries by first checking where problems are coming from. When you see an unexpectedly large number of queries, check your <strong>String Translation Tracking <\/strong>and <strong>Auto ID Adjust <\/strong>as potential sources.<\/p>\n<p>To learn more about identifying performance issues using the <strong>Debug Objects <\/strong>plugin, visit our <a href=\"https:\/\/wpml.org\/it\/faq\/how-to-debug-performance-problems\/\">FAQ on debugging performance problems<\/a>.<\/p>\n<h2>How to optimize String Translation Tracking?<\/h2>\n<p>String Translation Tracking triggers SQL queries when you&#8217;re logged in as Admin. To enhance performance, navigate to <strong>WPML <\/strong>\u2192 <strong>String Translation <\/strong>and make sure that <strong>Track where strings appear on the site <\/strong>is not checked. <\/p>\n<h2>How to optimize Auto ID Adjust?<\/h2>\n<p>If <strong>Adjust IDs for multilingual functionality<\/strong> is selected, WPML will perform SQL queries whenever the theme tries to load items with specific IDs.<\/p>\n<p>You can disable this option in in <strong>WPML <\/strong>\u2192 <strong>Languages <\/strong>\u2192 <strong>Make themes work multilingual <\/strong>and use <strong>icl_object_id<\/strong> and other functions from <a title=\"WPML Coding API\" href=\"https:\/\/wpml.org\/documentation\/support\/wpml-coding-api\/\">WPML&#8217;s API <\/a>instead, to turn your theme multilingual.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you see an unexpectedly large number of queries you can improve performance of translated pages by turning off the String Translation Tracking and Auto ID Adjust features.<\/p>\n","protected":false},"author":2,"featured_media":0,"menu_order":90,"template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_uag_custom_page_level_css":"","ep_exclude_from_search":false,"footnotes":""},"faq-category":[26137],"class_list":["post-7623","faq","type-faq","status-publish","hentry","faq-category-how-to"],"spectra_custom_meta":{"_edit_last":["578773"],"_edit_lock":["1693989607:578773"],"_icl_translator_note":[""],"_alp_processed":["1693989335"],"_views_template":["0"],"_subscription_coupon_product_id":["0"],"inline_featured_image":["0"],"_wpml_word_count":["205"],"_oembed_b9ed4048f72ad6c7db9e194b36b2ddd7":["<iframe title=\"Add a Custom Language in WPML\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/gbdbEOQA0Kw?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_b9ed4048f72ad6c7db9e194b36b2ddd7":["1598550361"],"_oembed_bb1b191ac01b88ca66d2e8506a6c7792":["<iframe title=\"How to find a WPML Email with your Account Information\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/FD42SGp2h3U?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_bb1b191ac01b88ca66d2e8506a6c7792":["1598604974"],"_oembed_6fb427da043bf71e85cff9f56216345b":["<iframe title=\"Using WPML to translate your pages built with Elementor.\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/uyeK177B9aM?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe>"],"_oembed_time_6fb427da043bf71e85cff9f56216345b":["1601551714"],"_wpv_contains_gutenberg_views":[""],"_wpml_location_migration_done":["1"],"_wpml_media_duplicate":["0"],"_wpml_media_featured":["1"],"_yoast_wpseo_content_score":["60"],"faq_order":["6"],"wpcf-faq-category":["6"],"_yoast_wpseo_estimated-reading-time-minutes":[""],"_yoast_wpseo_wordproof_timestamp":[""],"_yoast_wpseo_primary_faq-category":[""],"_oembed_91c4a966854e454ae9cd5d8238fe6125":["<iframe title=\"How Repeatable Field Groups Work in Toolset\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/aWB-upmpbfo?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>"],"_oembed_time_91c4a966854e454ae9cd5d8238fe6125":["1706096448"],"_oembed_605538d4bdc05d8e5064feba452e6920":["<iframe title=\"Creating and using repeatable field groups\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/1D501I-yvGI?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>"],"_oembed_time_605538d4bdc05d8e5064feba452e6920":["1706096448"],"_oembed_c0f0fe1223a8b20dc94265f83b277e94":["<iframe title=\"How to Display Content Conditionally in WordPress - Free Course\" width=\"700\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/0jaahChFodg?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>"],"_oembed_time_c0f0fe1223a8b20dc94265f83b277e94":["1706096448"],"_oembed_a2bd2c0b8f2c628b1b3793abb74e7359":["<iframe title=\"WPML 3.9 with &quot;Display as Translated&quot; mode\" width=\"525\" height=\"394\" src=\"https:\/\/www.youtube.com\/embed\/eiPUIuELo2A?feature=oembed&enablejsapi=1&origin=https:\/\/wpml.org\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe>"],"_oembed_time_a2bd2c0b8f2c628b1b3793abb74e7359":["1706096448"],"_uag_css_file_name":["uag-css-7623.css"],"_uag_page_assets":["a:9:{s:3:\"css\";s:260:\".uag-blocks-common-selector{z-index:var(--z-index-desktop) !important}@media(max-width: 976px){.uag-blocks-common-selector{z-index:var(--z-index-tablet) !important}}@media(max-width: 767px){.uag-blocks-common-selector{z-index:var(--z-index-mobile) !important}}\";s:2:\"js\";s:0:\"\";s:18:\"current_block_list\";a:1:{i:0;s:14:\"core\/shortcode\";}s:8:\"uag_flag\";b:0;s:11:\"uag_version\";s:10:\"1778508598\";s:6:\"gfonts\";a:0:{}s:10:\"gfonts_url\";s:0:\"\";s:12:\"gfonts_files\";a:0:{}s:14:\"uag_faq_layout\";b:0;}"]},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"gform-image-choice-sm":false,"gform-image-choice-md":false,"gform-image-choice-lg":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false},"uagb_author_info":{"display_name":"Amir","author_link":"https:\/\/wpml.org\/it\/author\/amir\/"},"uagb_comment_info":0,"uagb_excerpt":"When you see an unexpectedly large number of queries you can improve performance of translated pages by turning off the String Translation Tracking and Auto ID Adjust features.","_links":{"self":[{"href":"https:\/\/wpml.org\/it\/wp-json\/wp\/v2\/faq\/7623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpml.org\/it\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/wpml.org\/it\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/wpml.org\/it\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":8,"href":"https:\/\/wpml.org\/it\/wp-json\/wp\/v2\/faq\/7623\/revisions"}],"predecessor-version":[{"id":14349409,"href":"https:\/\/wpml.org\/it\/wp-json\/wp\/v2\/faq\/7623\/revisions\/14349409"}],"wp:attachment":[{"href":"https:\/\/wpml.org\/it\/wp-json\/wp\/v2\/media?parent=7623"}],"wp:term":[{"taxonomy":"faq-category","embeddable":true,"href":"https:\/\/wpml.org\/it\/wp-json\/wp\/v2\/faq-category?post=7623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}