{"id":16479782,"date":"2023-02-17T07:40:01","date_gmt":"2023-02-17T07:40:01","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/performance-issue-46\/"},"modified":"2023-02-17T07:40:01","modified_gmt":"2023-02-17T07:40:01","slug":"performance-issue-46","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/performance-issue-46\/","title":{"rendered":"Performance issue"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">One of my clients couldn&#8217;t access the media library anymore, is was timing out every time. The display is 250 items per page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In your function display_post_list_column, the query that gets the post_ids, took over 3 seconds per query, so it&#8217;s called 250 times, which caused the timeout.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I did some testing, in the query instead of doing LIKE &#8216;_thumbnail_id&#8217;, if you do = &#8216;_thumbnail_id&#8217;, from over 3 seconds, it takes 0.3s, 10 times faster, with this fix, it doesn&#8217;t timeout anymore.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this case the LIKE is not necessary, because you know the exact meta_key you are looking for.<\/p>\n","protected":false},"template":"","class_list":["post-16479782","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16479782","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/16479782\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=16479782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}