[wp-trac] [WordPress Trac] #36792: Cache Post ids in WP_Query

WordPress Trac noreply at wordpress.org
Mon May 9 18:49:53 UTC 2016


#36792: Cache Post ids in WP_Query
-------------------------------+-----------------------------
 Reporter:  spacedmonkey       |      Owner:
     Type:  enhancement        |     Status:  new
 Priority:  normal             |  Milestone:  Awaiting Review
Component:  Posts, Post Types  |    Version:  3.4
 Severity:  normal             |   Keywords:
  Focuses:  performance        |
-------------------------------+-----------------------------
 Current the WP_Query performs an SQL query every time it is run. The
 result of which is not cached.  When the sql query runs, it selects on the
 columns in the post table and sets up the post objects. The newer query
 classes however, only select the id column and then loop around to get
 each object using the get_* function. When the comment query for example
 queries for ids, it then queries the result. This cached result is
 invalided using the "last_changed" value in the comments group. This
 caching should be added to the WP_Query class as well.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36792>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list