Hi, I have a website with over 1.000.000 wp_postmeta rows. When I add (in homepage) an elementor Brand or Products object I have insanely slow queries around 0.5s that slow down the page to 20″ or more.
The query is this (and similar one) and it’s generated from the theme Brand shortcode or Products grid shortcode.
SELECT post_id, meta_value
FROM wpva_postmeta
WHERE meta_key = ‘_wp_attached_file’
AND meta_value = ‘2020/03/logo_vitakraft_2014.png’
If i select all row
SELECT * FROM wp_postmeta
I get 0.0005s
meta_value is the only column that isn’t indexed