WordPress.org

Make WordPress Core

Opened 11 months ago

Last modified 3 months ago

#24498 new enhancement

Improving performance of meta_form()

Reported by: lumaraf Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.5.1
Component: Administration Keywords:
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 (2)

comment:1 SergeyBiryukov11 months ago

  • Description modified (diff)

comment:2 nacin3 months ago

  • Component changed from Performance to Administration
  • Focuses performance added
Note: See TracTickets for help on using tickets.