Hello i have problem query ACF too slow.
Scenario :
I have custom posttype :
1. Club (id, CLUB NAME)
2. Match (home_club, goal_home, competition, away_club, goal_away)
3. competition (Id, competition name)
I try show head to head CLUB A VS Club B, so i will show all match ( Club A as home and Club B as away ) AND (Club A as away and club B as home). I use this query argument, but time to load 6s.
$type = 'match';
$args = array(
'post_type' => $type,
'posts_per_page' => '5',
'post_status' => 'publish',
'meta_query' => array(
array(
'relation' => 'AND',
array(
'key' => 'home_club',
'value' => $home[1],
'compare' => '='
),
array(
'key' => 'club_away',
'value' => $away[1],
'compare' => '='
), array(
'key' => 'is_finish',
'value' => true,
'compare' => '='
)
),
'relation' => 'OR',
array(
'relation' => 'AND',
array(
'key' => 'home_club',
'value' => $away[1],
'compare' => '='
),
array(
'key' => 'club_away',
'value' => $home[1],
'compare' => '='
), array(
'key' => 'is_finish',
'value' => true,
'compare' => '='
)
),
),
'orderby' => 'meta_value_num',
'meta_key' => 'tanggal_main',
'order' => 'desc',
);
Can you suggest me for better query.