[wp-trac] [WordPress Trac] #39358: Media search speed has been dramatically reduced
WordPress Trac
noreply at wordpress.org
Wed Jan 11 14:51:46 UTC 2017
#39358: Media search speed has been dramatically reduced
--------------------------+------------------------------
Reporter: merts | Owner: joemcgill
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.7
Severity: normal | Resolution: worksforme
Keywords: | Focuses: performance
--------------------------+------------------------------
Changes (by timbunch):
* status: reviewing => closed
* resolution: => worksforme
Comment:
Thank you! This has been an issue since we upgraded to 4.7. It thought my
DB was tanking on me at first with CPU spiking to 100%. With over 250k
images, I know we have more than the average user...
Replying to [comment:3 joemcgill]:
> Hi @merts,
>
> Here's one approach to disabling the filter if you so choose:
>
> {{{
> add_action( 'pre_get_posts', 'remove_query_attachment_filename_filter'
);
>
> function remove_query_attachment_filename_filter() {
> remove_filter( 'posts_clauses',
'_filter_query_attachment_filenames' );
> }
> }}}
>
> We also might need to experiment with adding an index for post meta that
targets the `_wp_attached_file` key as a way of reducing the query
performance concerns. I'd appreciate insight from @dd32 or @pento on
possibilities there.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39358#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list