WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found this query causing some load in the server, my hosting provdier asked me to look on it.


I think this select no. rows found in wp_posts table.. but i tried to this query in separate page, it takes so long to complete the request.Can somebody help me to overcome from this issue?


share|improve this question

WordPress uses this feature of MySQL to get a total count of posts when you are only retrieving limited amount (100 posts total, but only 10 posts per page).

From quick look at source there is no_found_rows query argument that can disable it. That will wreck pagination and should only be used with specific queries that don't need counting (for example get_posts() uses it by default).

You probably need to look into performance of your database overall (if you are running something crazy large) or if there are issues with configuration (if you are running something small enough to not possibly cause issues with resources).

share|improve this answer
as you said, if it is used only for pagination means, can i query manually. something like "select count(*) from wp_posts"? doest it affects pagination and others contents? – VKGS Jan 23 '12 at 12:34
@Sekar there is no guarantee that separate query would be any faster (it depends on database setup and I am not sure how would WP's database behave) and it sure would be huge pain to cleanly change from one to another. As per my answer I'd start looking into why it is slow instead of trying to get rid of it without insight into what is going on. – Rarst Jan 23 '12 at 12:39
i'll try and let you know... thanks for efforts. – VKGS Jan 23 '12 at 13:04

Your Answer


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.