I have a site with 100k+ posts and I am trying to use this query:
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 0, 5
After searching for quite some time now, I came to understand that it's a pagination query. The query takes too much time and is not efficient.
Does anyone know of a solution for this problem?
P.S. I have already searched the old answers but they do not provide any solution.