Make WordPress Core

Opened 5 months ago

Last modified 3 months ago

#57416 assigned enhancement

Do not split query if requesting one post

Reported by: spacedmonkey's profile spacedmonkey Owned by: spacedmonkey's profile spacedmonkey
Milestone: Future Release Priority: normal
Severity: normal Version: 3.0
Component: Query Keywords: good-first-bug needs-patch
Focuses: performance Cc:

Description

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.

Change History (1)

#1 @spacedmonkey
3 months ago

  • Owner set to spacedmonkey
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.