when we have 10 plus meta key i get 100% server usage. is there any option to optimize query.
$meta_query = array('relation' => 'AND');
foreach ($requestData as $key => $value) {
$meta_query[] = array(
'key' => $value,
'value' => '1',
'compare' => '='
);
}
$args = array( 'post_type' => 'healthcare', 'post_status' => 'publish', 'posts_per_page' => -1, 'meta_query' => $meta_query);
$loop = new WP_Query( $args );
$total = $loop->found_posts;