[wp-trac] [WordPress Trac] #61651: attachment_url_to_postid() performs possibly slow SELECT against meta_value

WordPress Trac noreply at wordpress.org
Mon Jul 15 17:42:09 UTC 2024


#61651: attachment_url_to_postid() performs possibly slow SELECT against meta_value
-------------------------+------------------------------
 Reporter:  apermo       |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Media        |     Version:  4.0
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:  performance
-------------------------+------------------------------

Comment (by apermo):

 Hello @adamsilverstein.

 While #61383 will allow custom solutions for edge cases, I think there
 should be a general improvement since not everyone will be aware of it,
 nor will be able to implement a solution.

 As mentioned beforehand, a lot of people will not be aware of this issue,
 I was not aware of it, before I wrote a custom tool for profiling and saw
 a 4s query, even though the site was already professionally maintained
 before, the other developers had not found the same issue.

 From a quick scan I'd say it describes the same issue and the described
 solution would be a fix for this topic. So I'd be happy to mark this as
 duplicate to #41281, my idea was to spark a discussion. That's why I also
 suggested looking for other solutions than just adding an index to
 {{{wp_postmeta}}}. I think there should be an open discussion for an
 improvement for everyone.

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


More information about the wp-trac mailing list