Opened 8 years ago
Closed 8 years ago
#39878 closed enhancement (duplicate)
meta_form inner query is very slow for big post_meta tables
Reported by: | eddr | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7.2 |
Component: | Options, Meta APIs | Keywords: | |
Focuses: | Cc: |
Description
- This query on every edit page:
SELECT DISTINCT meta_key FROM wp_postmeta WHERE meta_key NOT BETWEEN '_' AND '_z' HAVING meta_key NOT LIKE '\\_%' ORDER BY meta_key LIMIT 30
is really expensive.
- My site has big post_meta table as I'm using lots of custom fields (via advanced custom fields plugin).
- Removing the filters from the query, in my case, results in the same result set exactly
- There should be some option for built-in transient/cache of some sort for this specific one. This doesn't change almost at all, so flushing the cache won't be a problem
- The "order by" part takes really a lot in terms of performance and I'm not sure it is needed really. maybe a filter to allow the developer to change it?
Thanks
Change History (2)
Note: See
TracTickets for help on using
tickets.
Fixing and adding: