Support » Plugin: Query Monitor » Slow query – Component: core

  • Resolved Jay Collier

    (@jcollier)


    I am consistently having a slow query on edit pages and the component reported is Core.

    SELECT DISTINCT meta_key 
    FROM mltn_postmeta 
    WHERE meta_key NOT BETWEEN '_'
    AND '_z' 
    HAVING meta_key NOT LIKE '\\_%' 
    ORDER BY meta_key 
    LIMIT 30
    do_meta_boxes()
    wp-admin/includes/template.php:1304
    post_custom_meta_box()
    wp-admin/includes/meta-boxes.php:734
    meta_form()
    wp-admin/includes/template.php:678

    Can anyone point us toward a resource that would help us diagnose?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    meta_form() is indeed a slow function when you have a large number of entries in the postmeta table.

    Core ticket: https://core.trac.wordpress.org/ticket/33885

    Thank you so very much. That was the pointer we needed.

    For anyone else who has this problem: the recommended thread points out legacy problems with the custom fields metabox. After dozens of entries, a link near the bottom of the thread worked perfectly for us:

    https://9seeds.com/wordpress-admin-post-editor-performance/

    We are using Pods which, I believe, stores entries in the postmeta table. However, it has its own metabox display in the editor, so there no need for the custom fields box at all. The entire editor screen load time went down from 1.5 seconds to .4

    Pods does store custom fields in the postmeta table, unless you choose Table Storage which would write those custom fields into their own separate table.

    Thank you, Jim.

    Since the documentation seemed to suggest sticking with postmeta over separate tables, and that’s what we did. Disabling the custom fields metabox reduced the post edit load time significantly, so we’re all set.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Slow query – Component: core’ is closed to new replies.