[wp-trac] [WordPress Trac] #45354: Adding index for meta_key and post_id in postmeta

WordPress Trac noreply at wordpress.org
Tue Dec 19 22:49:54 UTC 2023


#45354: Adding index for meta_key and post_id in postmeta
----------------------------------------+------------------------------
 Reporter:  DuckDagobert                |       Owner:  (none)
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Database                    |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-testing dev-feedback  |     Focuses:  performance
----------------------------------------+------------------------------

Comment (by galbaras):

 Replying to [comment:8 johnbillion]:
 > Additional indexes also take up disk space. Ironically the sites that
 would benefit the most from this additional index would also experience
 the greatest increase in space usage. (I'm not against the change, just
 pointing this out.)

 In this day and age, disk space is cheap, but performance is golden.

 Replying to [comment:10 fliespl]:

 Have you tested `post_id, meta_key` against `meta_key, post_id`?

 Have you tested making either of those the primary index for the table?

 It would be great if you could do this and report your findings.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45354#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list