[wp-trac] [WordPress Trac] #52759: Add a filter to get_available_post_mime_types() function to allow overriding extremely slow query.

WordPress Trac noreply at wordpress.org
Mon May 23 11:12:09 UTC 2022


#52759: Add a filter to get_available_post_mime_types() function to allow
overriding extremely slow query.
--------------------------------------+------------------------------
 Reporter:  maciejmackowiak           |       Owner:  (none)
     Type:  feature request           |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Media                     |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:  performance
--------------------------------------+------------------------------

Comment (by priard):

 Replying to [comment:2 archon810]:
 >
 > For us, it adds an additional 0.35s or so (right now, more if db is
 loaded).
 >
 >
 > {{{
 > SELECT SQL_NO_CACHE DISTINCT post_mime_type
 > FROM wp_posts
 > WHERE post_type = 'attachment'
 > > OK
 > > Time: 0.35s
 > }}}
 >
 > and I hope with the new proposed filter, we will be able to speed up the
 site even more.

 Ok, let's say a new filter is added, what next? How would you like to
 improve the query for better performance?

 Drop an example of such a query. I am curious about your experience with
 this.

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


More information about the wp-trac mailing list