[wp-trac] [WordPress Trac] #46709: AND ( mx_postmeta.meta_key = 'post_views_count' ) called when there is no need to

WordPress Trac noreply at wordpress.org
Fri Mar 29 11:19:20 UTC 2019


#46709: AND ( mx_postmeta.meta_key = 'post_views_count' ) called when there is no
need to
--------------------------+----------------------
 Reporter:  vadikcoma     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Database      |     Version:
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |     Focuses:
--------------------------+----------------------
Changes (by earnjam):

 * status:  new => closed
 * version:  5.1 =>
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Hi @vadikcoma and welcome to WordPress Trac!

 Postmeta queries can be slow due to lack of indexing on the `meta_value`
 column. When you have to join those across large databases, as you've
 seen, performance can be pretty bad.

 In this case, it's not an issue with WordPress Core. Your theme is making
 these calls, so you should find a way to optimize the theme's code,
 probably either through adjustments to the queries or some sort of
 caching.

 WordPress Trac is used for tracking bugs and enhancements for WordPress
 core, so I'm going to close this ticket. The best place to follow up for
 additional help would be the support forums at
 https://wordpress.org/support/forums/

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


More information about the wp-trac mailing list