Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This query given below appears alot in my slow-query log. Can someone please tell me where can I find this query ? that will help me try to modify it

SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts WHERE 1=1 AND (((wp_posts.post_title LIKE '%true%') OR (wp_posts.post_content LIKE '%true%'))) AND (wp_posts.post_password = '') AND wp_posts.post_type IN ('post', 'page', 'attachment', 'slideshow') AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 10;
share|improve this question
    
Might wish to start with a quick google: google.com/search?q=wordpress+SELECT+SQL_CALC_FOUND_ROWS –  t31os Mar 19 '11 at 11:34
add comment

1 Answer 1

This looks like a query generated as part of the search facility within Wordpress. For example, a visitor has been to your site and typed the word 'true' into your search box.

If you have a large number of posts/pages/etc in your Wordpress installation, then the only way you could optimise this query is to use fulltext indexing. This would mean actually changing the functionality of the search facility within the Wordpress core. I'm not too hot on fulltext indexing within MySQL unfortunately, else I would be able to offer more help.

This might be a good starting point though: http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

share|improve this answer
    
I am not using wordpress search, I am using google search on this site. –  Umair Mar 21 '11 at 7:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.