[wp-trac] Re: [WordPress Trac] #8561: query in meta_form() function in /wp-admin/includes/template.php causes post/page editing to load slowly

WordPress Trac wp-trac at lists.automattic.com
Sun Dec 14 18:46:13 GMT 2008


#8561: query in meta_form() function in /wp-admin/includes/template.php causes
post/page editing to load slowly
---------------------------------------------------+------------------------
 Reporter:  fastpipe                               |        Owner:  anonymous
     Type:  defect                                 |       Status:  new      
 Priority:  high                                   |    Milestone:  2.8      
Component:  Optimization                           |      Version:  2.7      
 Severity:  critical                               |   Resolution:           
 Keywords:  meta_key,postmeta,post,page has-patch  |  
---------------------------------------------------+------------------------
Comment (by vladimir_kolesnikov):

 Replying to [comment:3 mrmist]:
 MySQL is able to use index for DISTINCT, WHERE ... NOT LIKE will be
 applied to the result of SELECT DISTINCT meta_key. Thus the speed of WHERE
 will depend on the cardinality of distinct meta keys.

 The only alternative I see is to add an indexed column (say,
 'special_key') which will be 1 for keys starting with '_' and 0 otherwise.
 Then MySQL will be able to use index both for WHERE and DISTINCT.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8561#comment:4>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list