[wp-trac] [WordPress Trac] #41278: SQL_CALC_FOUND_ROWS slow queri

WordPress Trac noreply at wordpress.org
Sun Jul 9 17:12:12 UTC 2017


#41278: SQL_CALC_FOUND_ROWS slow queri
--------------------------+-----------------------------
 Reporter:  lubimow       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.8
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In the logs of slow queries when searching for steel, the following types
 of logs appear:



 {{{
 SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID
 FROM wp_posts
 WHERE 1=1
 AND (((wp_posts.post_title
 LIKE '%donald%') OR (wp_posts.post_excerpt
 LIKE '%donald%') OR (wp_posts.post_content
 LIKE ‘%donald%’)) AND ((wp_posts.post_title
 LIKE '%trump%') OR (wp_posts.post_excerpt
 LIKE ‘%trump%’) OR (wp_posts.post_content
 LIKE '%trump%')))
 AND wp_posts.post_type
 IN ('post', 'page', 'attachment')
 AND (wp_posts.post_status = 'publish'
 OR wp_posts.post_status = 'acf-disabled'
 OR wp_posts.post_author = 186
 AND wp_posts.post_status = 'private')
 ORDER BY (CASE WHEN wp_posts.post_title
 LIKE ‘%donald trump%' THEN 1 WHEN wp_posts.post_title
 LIKE ‘%donald%’ AND wp_posts.post_title
 LIKE '%trump%' THEN 2 WHEN wp_posts.post_title
 LIKE '%donald%' OR wp_posts.post_title
 LIKE '%trump%' THEN 3 WHEN wp_posts.post_excerpt
 LIKE '%donald trump%' THEN 4 WHEN wp_posts.post_content
 LIKE '%donald trump%' THEN 5 ELSE 6 END),
 wp_posts.post_date DESC LIMIT 0, 30;
 }}}

 How can I eliminate it?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41278>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list