Query causing load because of SQL_CALC_FOUND_ROWS post counting?

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).

Leave a Comment