[wp-trac] [WordPress Trac] #43636: Additional wp_query 'fields' choices

WordPress Trac noreply at wordpress.org
Tue Apr 17 22:33:49 UTC 2018


#43636: Additional wp_query 'fields' choices
-------------------------------------------------+-------------------------
 Reporter:  mattkeys                             |       Owner:  (none)
     Type:  enhancement                          |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Query                                |     Version:  4.9.5
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback needs-        |     Focuses:
  testing has-unit-tests                         |  performance
-------------------------------------------------+-------------------------

Comment (by boonebgorges):

 Hi @mattkeys - Thanks for the ticket and for the patches.

 The idea to introduce additional values for `fields` has come up numerous
 times in the past. See #19866, #33519, #14777. The structural problem is
 that fine-grained `SELECT` fields pose problems for the post cache. See
 https://core.trac.wordpress.org/ticket/19866#comment:6 and follow-up
 discussion.

 Post queries are a somewhat special case, because the posts table has a
 couple of `longtext` fields that can get very large and lead to
 performance problems that are quite real (as opposed to some
 microoptimizations that you might achieve by not querying `post_author`,
 `post_parent`, etc). A more promising strategy might therefore be to have
 a way of *excluding* certain fields. See
 https://core.trac.wordpress.org/ticket/19866#comment:21. So, you'd have a
 flag (or multiple flags?) for excluding `post_content`, perhaps
 `post_excerpt`. And this flag would have to play reasonably nicely with
 post caches: use the values from the cache where available, but never
 populate the individual post cache with incomplete entries.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/43636#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list