[wp-trac] [WordPress Trac] #45354: Adding index for meta_key and post_id in postmeta
WordPress Trac
noreply at wordpress.org
Sat Mar 30 23:41:06 UTC 2024
#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):
I'm really hoping the core team (is there a performance team, or maybe the
hosting team) would seriously consider this change. The imagify query
above isn't typical, but running the usual WordPress testing through both
the `post_id, meta_key` and `meta_key, post_id` options should be fairly
easy and can truly improve WordPress performance.
Which index performs better is based on the cardinality of each column,
and on most sites, `post_id` has the larger cardinality (1,000 posts with
50 meta keys is more likely than the reverse), but actually testing is
best.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45354#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list