Bad Queries
-
I have a website on WordPress that receive 500 hits per day, recently my web host decreased the limit of the connexions with database because they said that my queries were not effective and were damaging the server.
The queries pointed by they, are:
# Query_time: 10.657546 Lock_time: 0.000036 Rows_sent: 6 Rows_examined: 372 SET timestamp=1412492578; SELECT * FROM wp_comments WHERE comment_approved = '1' AND comment_post_ID = 16018 ORDER BY comment_date_gmt ASC; # Query_time: 10.714655 Lock_time: 0.000107 Rows_sent: 10 Rows_examined: 22721 SET timestamp=1412492927; SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE '%uc%') OR (wp_posts.post_content LIKE '%uc%'))) AND (wp_posts.post_password = '') AND wp_posts.post_type IN ('post', 'page', 'attachment', 'diario-de-bordo', 'ims_gallery') AND (wp_posts.post_status = 'publish') OR ( ID IN ( SELECT DISTINCT post_parent FROM wp_posts WHERE 1=1 AND ((wp_posts.post_title LIKE '%uc%') OR (wp_posts.post_content LIKE '%uc%') OR (wp_posts.post_excerpt LIKE '%uc%') OR (wp_posts.post_excerpt LIKE '%uc%')) AND wp_posts.post_status = 'publish')) ORDER BY wp_posts.post_title ASC LIMIT 590, 10;
The first I belive that is a listing of comments in one post and the second a search, both are native functions of WordPress and were not changed, are there anyway of improve them?
One thing that I think is unusual, is that these queries don’t take too long time on phpMyAdmin, should be much difference? What can I do to improve these queries? Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Bad Queries’ is closed to new replies.