[wp-trac] [WordPress Trac] #44580: The function attachment_url_to_postid in wp-includes/media.php causes a slow query for a huge database
WordPress Trac
noreply at wordpress.org
Fri Jul 13 10:37:43 UTC 2018
#44580: The function attachment_url_to_postid in wp-includes/media.php causes a
slow query for a huge database
-------------------------+-----------------------------
Reporter: samvthom16 | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.9.7
Severity: normal | Keywords:
Focuses: performance |
-------------------------+-----------------------------
We have close to 40k posts and equivalent number of items in the media
library. Lot of plugins like Yoast Seo use the function
attachment_url_to_postid() quite often. This causes a slow query because
of the huge database.
Solution:
Since URLs don't change that often. The function can use transient
variables instead of querying the posts table.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44580>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list