How to create index (sql) to a meta_key?

I’m not going to tell you about what will happen. I’ll here give you an example on how you can run that piece of sql without phpMyadmin. Add this to your functions.php for temporary purpose. Not to forget about removing this after one run of your website.

$mymeta="_my_first_meta";
$wpdb->query(
   $wpdb->prepare("CREATE INDEX wp_postmeta_my_first_meta ON wp_postmeta (%s)",$mymeta)
);

Don’t forget to replace your Database Prefix with “wp_