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

  • Resolved Jay Collier


    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

    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


    WordPress Core Developer

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

    Core ticket:

    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:

    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.