• Resolved chriscombsdc

    (@chriscombsdc)


    Hello! We are running Media Library Assistant 2.60 (promise we’ll update soon) and noticed some fairly heavy SQL queries running on admin editor pageloads:

    #16 (186.9 ms)

    SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
    FROM wp_posts
    WHERE post_type = ‘attachment’
    ORDER BY post_date DESC

    #18 (177.3 ms)

    SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month
    FROM wp_posts
    WHERE post_type = ‘attachment’
    ORDER BY post_date DESC

    About 350ms for us per admin pageload.

    It seems like this could be a good candidate for the WP object cache, what do you think?

    You’ve made a lovely plugin. Thank you for your time.

    Cheers,
    Chris

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for the kind words and for your report.

    I am travelling until December 11 and away from my development system. I will investigate the issue you reported as soon as I return home. Thanks for your understanding and your patience.

    Plugin Author David Lingren

    (@dglingren)

    I have found and removed the duplicate “Months dropdown” database query on the Media/Edit Media admin submenu. The fix takes advantage of a new filter added to WordPress in version 4.7.4; it won’t work with earlier WordPress versions.

    The fix will be in my next MLA version, but you can try it out by installing the MLA Development Version dated 20171213. To get the Development Version, follow the instructions in this earlier topic:

    504 Time-Out issue

    It would be great if you can confirm the fix. I will leave this topic unresolved until the fix goes out in the next official MLA version.

    Thanks for motivating an MLA enhancement!

    Thread Starter chriscombsdc

    (@chriscombsdc)

    Beautiful! Many thanks!

    We will aim to test this in our next staging deployment.

    Thread Starter chriscombsdc

    (@chriscombsdc)

    This does seem to be working well for us. Thanks again.

    Plugin Author David Lingren

    (@dglingren)

    I have released MLA version 2.70, which includes the fix for this issue. I am marking the topic resolved, but please update it if you have any problems or further questions regarding the fix in this new version.

    Thanks again for your help with testing the fix.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘cache query results in _months_dropdown() ?’ is closed to new replies.