Quantcast
Channel: WordPress.org Forums » [Index WP MySQL For Speed] Support
Viewing all articles
Browse latest Browse all 70

Slower looks up with meta_id sort from update_meta_cache

$
0
0

Replies: 0

I’m trying to speed up slow queries from the update_meta_cache function in WP which sorts postmeta post id looks up by the meta_id column, as below:

SELECT post_id, meta_key, meta_value
FROM wp_postmeta
WHERE post_id IN (100,….)
ORDER BY meta_id ASC;

Adding the indexes in this plugin seems to add an additional 90ms on large look ups (when requesting hundreds of IDs) than the standard indexes.

Do you have any suggestions on potential indexes that could be added to speed up sorting by meta_id? I’m guessing because the meta_id isn’t in the original select, it results in an extra order by filesort which is much slower?


Viewing all articles
Browse latest Browse all 70

Trending Articles