Make WordPress Core

Opened 5 years ago

Last modified 3 years ago

#24498 closed enhancement

Improving performance of meta_form() — at Version 1

Reported by: lumaraf Owned by:
Milestone: 4.3 Priority: normal
Severity: normal Version: 3.5
Component: Administration Keywords: has-patch
Focuses: performance Cc:

Description (last modified by SergeyBiryukov)

The query executed in meta_form() in wp-admin/includes/template.php took over 5 seconds to execute on my largest wordpress installation. I changed it to use a NOT BETWEEN to enable MySQL to execute the query by just using a small part of the meta_key index. My new query executes in less than 10 milliseconds.

Here is the improved query:

SELECT DISTINCT meta_key FROM wp_postmeta
WHERE meta_key NOT BETWEEN '_' AND '_z'
HAVING meta_key NOT LIKE '\_%'
ORDER BY meta_key

Change History (1)

#1 @SergeyBiryukov
5 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.