SELECT COUNT(*) FROM wp_posts WHERE ( ( post_type = ‘post’ AND ( post_status = ‘publish’ OR post_status = ‘private’ ) ) ) AND post_author = 1; Alter table wp_posts add index status_index(post_type,post_status,post_author);

ERROR 1067 (42000): Invalid default value for ‘post_date’ SET SQL_MODE=’ALLOW_INVALID_DATES’; Execute again and resolve the problem