Wordpress-seo: Slow query plugin yoast (_yoast_wpseo_focuskw)

Created on 20 Nov 2017  ·  26Comments  ·  Source: Yoast/wordpress-seo

We have a big site with so many visitors... We use yoast seo plugin but we have many problems about yoast plugin ...

((
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts 
INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) 
WHERE 1=1 AND wp_posts.ID NOT IN (455046) 
AND ( ( wp_postmeta.meta_key = '_yoast_wpseo_focuskw' 
AND wp_postmeta.meta_value = '??????? ???????' ) ) 
AND wp_posts.post_type IN ('post', 'page', 'attachment') 
AND (wp_posts.post_status = 'publish' 
OR wp_posts.post_status = 'future' 
OR wp_posts.post_status = 'draft' 
OR wp_posts.post_status = 'pending' 
OR wp_posts.post_author = 34 
AND wp_posts.post_status = 'private') 
GROUP BY wp_posts.ID 
ORDER BY wp_posts.post_date DESC LIMIT 0, 2
))

Now We have 2 important questions: 1.Will you have a solution to fix this problem in the next update?

2.If we purchase ultimate pro version we won't have these mentioned errors? Thx in advance for your response..

Technical info

  • WordPress version: 4.9
  • Yoast SEO version: 5.8
0.5 Management performance minor

All 26 comments

@mehdiraized Thanks for reporting this issue.

Unfortunately we do not have enough information to reproduce this problem. Please follow these guidelines to improve your bug report.

At least tell us on what pages the slow query is causing you problems.

Thank you.

@Xyfi
Hi
On the wp-admin/post-new.php of the yoast Seo section when
writing in input yoast_wpseo_focuskw_text_input
Send Request Ajax and Run Query

SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) WHERE 1=1 AND wp_posts.ID NOT IN (471976) AND ( ( wp_postmeta.meta_key = '_yoast_wpseo_focuskw' AND wp_postmeta.meta_value = 'test' ) ) AND wp_posts.post_type IN ('post', 'page', 'attachment') AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_author = 34 AND wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 2 ))

screen shot 1396-08-29 at 15 23 55

We're having the same issue.

focuskw

WordPress version: 4.9
Yoast SEO Premium: 5.7.1

Are you guys looking into this? Have several customers complaining.

I apologize for not getting back to you sooner. We are currently looking into fixing this. The query calculates whether the focus keyword was already used before and can unfortunately not get any faster right now. We're looking into solutions to fasten it up another way, but unfortunately we do not have a time estimate when that will be. I apologize for any inconvenience this may cause and I thank you for your patience.

Caroline,

Thank you for responding. Why does the query run on every page in the
admin? Is there a way to disable that with hooks?

Brad

On Fri, Dec 15, 2017 at 2:38 AM, Caroline Geven notifications@github.com
wrote:

I apologize for not getting back to you sooner. We are currently looking
into fixing this. The query calculates whether the focus keyword was
already used before and can unfortunately not get any faster right now.
We're looking into solutions to fasten it up another way, but unfortunately
we do not have a time estimate when that will be. I apologize for any
inconvenience this may cause and I thank you for your patience.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Yoast/wordpress-seo/issues/8297#issuecomment-351973060,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACKBiD9zTUpRbPpovayTD8pbpay2Slt_ks5tAkw3gaJpZM4Qj63s
.

+1. Very slow (and getting worse) everytime that runs.

Please inform the customer of conversation # 330205 when this conversation has been closed.

Please inform the customer of conversation # 412276 when this conversation has been closed.

The query seems to only run on edit pages (where a keyphrase is used). Even though I can't reproduce the slowness, the query does not seem to have changed and I can see why it would become slow, so I will leave this thread open.

This fix worked for us.[image: image.png]

On Fri, Mar 22, 2019 at 1:21 AM Jannes notifications@github.com wrote:

The query seems to only run on edit pages (where a keyphrase is used).
Even though I can't reproduce the slowness, the query does not seem to have
changed and I can see why it would become slow, so I will leave this thread
open.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/Yoast/wordpress-seo/issues/8297#issuecomment-475531599,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACKBiG3n4DWolEEx9MLlrokiDZOk030nks5vZJKagaJpZM4Qj63s
.

Seems that while this query probably can't be optimized much, there should be a filter that allows us to disable the functionality entirely. I imagine there are a large # of users out there who are simply using Yoast to set meta descriptions and titles.

Would the Yoast team be interested in a PR implementing a filter to skip this functionality? Happy to provide.

Hi @ethanclevenger91, thanks for the offer! I will see if our product owners would like to see this get implemented.

The problem is that we have to query for a specific meta_value (the focus keyword), and there's no index on that column. Building an index on that column also isn't an option. We have another solution in the works, which is a separate table for all this data where we _can_ have an index on that column.

@jdevalk Yeah I understand _why_ it's slow. And a dedicated set of tables for Yoast will definitely be a great path forward for improving performance across the board, but in the meantime, it'd be great to opt out of this feature.

Unfortunately, building that costs development time too, time I'd rather spent getting our indexables table live.

Please inform the customer of conversation # 557508 when this conversation has been closed.

The above customer has a quite large site (38,827 posts and 82,318 attachments) which crashed due to this issue. His hosting provider (Siteground) identified these slow queries generated by Yoast:

Date: 2019-11-09 15:58:50 Query_time: 111.846708 Rows_examined: 33353: Rows_sent 0 Lock_time: 0.000215
# Schema: mohamm87_sima Last_errno: 0 Killed: 0 SELECT SQL_CALC_FOUND_ROWS sima_posts.ID FROM sima_posts INNER JOIN sima_postmeta ON ( sima_posts.ID = sima_postmeta.post_id ) WHERE 1=1 AND sima_posts.ID NOT IN (269276) AND ( ( sima_postmeta.meta_key = '_yoast_wpseo_focuskw' AND sima_postmeta.meta_value = 'نرخ بیک' ) OR ( sima_postmeta.meta_key = '_yoast_wpseo_focuskeywords' AND sima_postmeta.meta_value LIKE '%\"keyword\":\"نرخ بیک\"%' ) ) AND sima_posts.post_type IN ('post', 'page', 'attachment', 'donation', 'donor', 'funds', 'vc4_templates') AND (sima_posts.post_status = 'publish' OR sima_posts.post_status = 'future' OR sima_posts.post_status = 'draft' OR sima_posts.post_status = 'pending' OR sima_posts.post_author = 93 AND sima_posts.post_status = 'private') GROUP BY sima_posts.ID ORDER BY sima_posts.post_date DESC LIMIT 0, 2;
Date: 2019-11-09 15:56:55 Query_time: 118.690113 Rows_examined: 33353: Rows_sent 0 Lock_time: 0.000107
# Schema: mohamm87_sima Last_errno: 1160 Killed: 0 SELECT SQL_CALC_FOUND_ROWS sima_posts.ID FROM sima_posts INNER JOIN sima_postmeta ON ( sima_posts.ID = sima_postmeta.post_id ) WHERE 1=1 AND sima_posts.ID NOT IN (269276) AND ( ( sima_postmeta.meta_key = '_yoast_wpseo_focuskw' AND sima_postmeta.meta_value = 'اقتصاد آمریک' ) OR ( sima_postmeta.meta_key = '_yoast_wpseo_focuskeywords' AND sima_postmeta.meta_value LIKE '%\"keyword\":\"اقتصاد آمریک\"%' ) ) AND sima_posts.post_type IN ('post', 'page', 'attachment', 'donation', 'donor', 'funds', 'vc4_templates') AND (sima_posts.post_status = 'publish' OR sima_posts.post_status = 'future' OR sima_posts.post_status = 'draft' OR sima_posts.post_status = 'pending' OR sima_posts.post_author = 93 AND sima_posts.post_status = 'private') GROUP BY sima_posts.ID ORDER BY sima_posts.post_date DESC LIMIT 0, 2;



md5-de4e1b6880cb3f7a5e2a34344e7796c6



Date: 2019-11-09 16:29:44 Query_time: 118.892283 Rows_examined: 33353: Rows_sent 0 Lock_time: 0.000090
# Schema: mohamm87_sima Last_errno: 0 Killed: 0 SELECT SQL_CALC_FOUND_ROWS sima_posts.ID FROM sima_posts INNER JOIN sima_postmeta ON ( sima_posts.ID = sima_postmeta.post_id ) WHERE 1=1 AND sima_posts.ID NOT IN (269276) AND ( ( sima_postmeta.meta_key = '_yoast_wpseo_focuskw' AND sima_postmeta.meta_value = 'فریادم' ) OR ( sima_postmeta.meta_key = '_yoast_wpseo_focuskeywords' AND sima_postmeta.meta_value LIKE '%\"keyword\":\"فریادم\"%' ) ) AND sima_posts.post_type IN ('post', 'page', 'attachment', 'donation', 'donor', 'funds', 'vc4_templates') AND (sima_posts.post_status = 'publish' OR sima_posts.post_status = 'future' OR sima_posts.post_status = 'draft' OR sima_posts.post_status = 'pending' OR sima_posts.post_author = 93 AND sima_posts.post_status = 'private') GROUP BY sima_posts.ID ORDER BY sima_posts.post_date DESC LIMIT 0, 2;



md5-de4e1b6880cb3f7a5e2a34344e7796c6



# Schema: mohamm87_sima Last_errno: 1160 Killed: 0 SELECT SQL_CALC_FOUND_ROWS sima_posts.ID FROM sima_posts INNER JOIN sima_postmeta ON ( sima_posts.ID = sima_postmeta.post_id ) WHERE 1=1 AND sima_posts.ID NOT IN (269276) AND ( ( sima_postmeta.meta_key = '_yoast_wpseo_focuskw' AND sima_postmeta.meta_value = 'فریادمیهنشماره' ) OR ( sima_postmeta.meta_key = '_yoast_wpseo_focuskeywords' AND sima_postmeta.meta_value LIKE '%\"keyword\":\"فریادمیهنشماره\"%' ) ) AND sima_posts.post_type IN ('post', 'page', 'attachment', 'donation', 'donor', 'funds', 'vc4_templates') AND (sima_posts.post_status = 'publish' OR sima_posts.post_status = 'future' OR sima_posts.post_status = 'draft' OR sima_posts.post_status = 'pending' OR sima_posts.post_author = 93 AND sima_posts.post_status = 'private') GROUP BY sima_posts.ID ORDER BY sima_posts.post_date DESC LIMIT 0, 2;

Having the same issue here

image

Do you have any change for this?

Wordpress Version: 5.3
Yoast SEO Version: 12.3

Please inform the customer of conversation # 575370 when this conversation has been closed.

any update on this issue?

Not on this issue in specific, but we're planning to release our indexables feature in the near future. And that feature probably fixes this issue.

after 2 years not fixed ?

Also experiencing these kinds of slow query issues recurrently.
@Djennez do you have a an approximate release date for the feature you are talking about by any chance?

@laurent-le-graverend I don't have any specifics, but I am hoping before or in Q2.

Please inform the customer of conversation # 588279 when this conversation has been closed.

Was this page helpful?
0 / 5 - 0 ratings