get_posts query is taking about 40 seconds to execute

So, I actually fixed the issue by reversing the order of the OR conditions. If anyone knows why this fixed it, I’d love to know.

$next_event = get_posts( array(
    'post_type'     => 'event',
    'post_status'   => 'publish',
    'numberposts'   => 1,
    'fields'        => 'ids',
    'meta_query'    => array(
        'relation' => 'OR',
        array(
            'key' => '_post_date_year',
            'value' => $year,
            'compare' => '>',
            'type' => 'numeric',
        ),
        array(
            'relation' => 'AND',
            array(
                'key' => '_post_date_year',
                'value' => $year,
                'compare' => '=',
                'type' => 'numeric',
            ),
            array(
                'key' => '_post_date_month',
                'value' => $month,
                'compare' => '>',
                'type' => 'numeric',
            ),
        ),
    ),
    'meta_key'      => '_post_sort_date',
    'orderby'       => 'meta_value_num',
    'order'         => 'ASC',
) );