def METHOD_NAME():
    """The main function. Hier spielt die Musik.
    """
    # logic taken from mysqltuner.pl:mysql_stats(), section # Sorting, v1.9.8
    # including variable names
    # parse the command line, exit with UNKNOWN if it fails
    try:
        args = parse_args()
    except SystemExit:
        sys.exit(STATE_UNKNOWN)
    mysql_connection = {
        'defaults_file':  args.DEFAULTS_FILE,
        'defaults_group': args.DEFAULTS_GROUP,
        'timeout':        args.TIMEOUT,
    }
    conn = lib.base.coe(lib.db_mysql.connect(mysql_connection))
    lib.base.coe(lib.db_mysql.check_select_privileges(conn))
    myvar = lib.db_mysql.lod2dict(get_vars(conn))
    mystat = lib.db_mysql.lod2dict(get_status(conn))
    lib.db_mysql.close(conn)
    # init some vars
    msg = ''
    state = STATE_OK
    perfdata = ''
    # calculations
    mycalc = {}
    mycalc['total_sorts'] = int(mystat['Sort_scan']) + int(mystat['Sort_range'])
    if mycalc['total_sorts'] > 0:
        mycalc['pct_temp_sort_table'] = round(int(mystat['Sort_merge_passes']) / int(mycalc['total_sorts']) * 100)
    else:
        mycalc['pct_temp_sort_table'] = 0
    # Sorting
    msg += '{} sorts used a full table scan. '.format(
        lib.human.number2human(mystat['Sort_scan']),
    )
    if mycalc['total_sorts'] == 0:
        msg += 'No sort required temporary tables.'
    else:
        msg += 'Sorts requiring temporary tables: {}% ({} temp sorts / {} sorts)'.format(
            mycalc['pct_temp_sort_table'],
            lib.human.number2human(mystat['Sort_merge_passes']),
            lib.human.number2human(mycalc['total_sorts']),
        )
        if mycalc['pct_temp_sort_table'] > 10:
            sort_state = STATE_WARN
            state = lib.base.get_worst(state, sort_state)
            msg += '{}. Set sort_buffer_size > {} and/or read_rnd_buffer_size > {}.'.format(
                lib.base.state2str(state, prefix=' '),
                myvar['sort_buffer_size'],
                myvar['read_rnd_buffer_size'],
            )
        else:
            msg += '.'
    perfdata += lib.base.get_perfdata('mysql_read_rnd_buffer_size', myvar['read_rnd_buffer_size'], 'B', None, None, 0, None)
    perfdata += lib.base.get_perfdata('mysql_sort_buffer_size', myvar['sort_buffer_size'], 'B', None, None, 0, None)
    perfdata += lib.base.get_perfdata('mysql_sort_merge_passes', mystat['Sort_merge_passes'], 'c', None, None, 0, None)
    perfdata += lib.base.get_perfdata('mysql_sort_range', mystat['Sort_range'], 'c', None, None, 0, None)
    perfdata += lib.base.get_perfdata('mysql_sort_scan', mystat['Sort_scan'], 'c', None, None, 0, None)
    perfdata += lib.base.get_perfdata('mysql_pct_temp_sort_table', mycalc['pct_temp_sort_table'], '%', None, None, 0, 100)
    perfdata += lib.base.get_perfdata('mysql_total_sorts', mycalc['total_sorts'], 'c', None, None, 0, None)
    # over and out
    lib.base.oao(msg, state, perfdata, always_ok=args.ALWAYS_OK)