The problem I am having is when I allow users to filter posts it overpowers the database and things run extremely slow. I am unsure what the best way to query posts using meta values is. My site has a form that users can submit to filter posts based on checkboxes containing meta values. I currently have the site making an array out of the checkboxes selected for individual post_meta keys like so:
There’s nothing you can do in the the code to make the query any more efficient. What I suspect is happening is that you have a very large database and it’s simply taking a long time to run the MySQL query. Or perhaps the MySQL server is slow. You could look at moving to a dedicated server to see if that helps.
Viewing 1 replies (of 1 total)
The topic ‘What is an efficient way to query based on post_meta?’ is closed to new replies.