Opened 7 years ago
Closed 7 years ago
#44580 closed enhancement (duplicate)
The function attachment_url_to_postid in wp-includes/media.php causes a slow query for a huge database
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.9.7 |
| Component: | Media | Keywords: | |
| Focuses: | performance | Cc: |
Description
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.
Change History (1)
Note: See
TracTickets for help on using
tickets.
Thanks for your report @samvthom16
This has already been reported in #41281.
Please join in there, thanks.