Title: Bad Queries
Last modified: August 22, 2016

---

# Bad Queries

 *  [chodos](https://wordpress.org/support/users/chodos/)
 * (@chodos)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/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)

 *  [Bob Cristello](https://wordpress.org/support/users/gntmidnight/)
 * (@gntmidnight)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/bad-queries/#post-5374714)
 * Maybe you should consider working with a WordPress friendly hosting company. 
   I have never had any complaints about native WordPress Core queries, ever.

Viewing 1 replies (of 1 total)

The topic ‘Bad Queries’ is closed to new replies.

## Tags

 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Bob Cristello](https://wordpress.org/support/users/gntmidnight/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/bad-queries/#post-5374714)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
