[wp-trac] [WordPress Trac] #57416: Do not split query if requesting one post
WordPress Trac
noreply at wordpress.org
Tue Jan 3 13:49:30 UTC 2023
#57416: Do not split query if requesting one post
--------------------------+----------------------------------------
Reporter: spacedmonkey | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Query | Version: 3.0
Severity: normal | Keywords: good-first-bug needs-patch
Focuses: performance |
--------------------------+----------------------------------------
When using WP_Query and requesting posts_per_page = 1, there is little to
no value in splitting the query and priming posts using
_prime_post_caches. This results in one query to get the posts and another
to prime it. This means two database queries when this could simply be
one.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57416>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list