How long should get_posts be taking with ~8000 posts?
-
Was having issues with the Advanced Custom Fields plugin’s option screen timing out on me, and I managed to track down the issue to the get_posts function it’s calling with both the numberposts and posts_per_page options set to -1… so it’s attempting to pull back every post on the site.
While I consider this behavior problematic (and I plan on contacting the plugin’s author about it), it seems to me that such a query shouldn’t take nearly that long. When I do a select on the IDs in the posts table in mysql, I get a complete list of IDs in less than a second.
So my question is: Is this normal behavior for the get_posts function? If so, why so un-optimized… and is there any thing I can do about it so that I can actually use Advanced Custom Fields?
The topic ‘How long should get_posts be taking with ~8000 posts?’ is closed to new replies.