Running a simple SELECT on an optimised WordPress database takes 20 seconds, as it returns 62,000 records. Does anyone have a suggestion on how to improve these timings?
My code:
global $wpdb;
$entries_sql = $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '%s' AND meta_value='%s'", 'sht_ranking_id', $ranking_id);
$entry_ids = $wpdb->get_results($entries_sql, ARRAY_N);
(I've also tried running the raw SQL using PHPMyAdmin and it's no quicker.)